MoPub Macros

Macros List

MoPub supports the following macros:

Type Macro
Ad Group ID %eaid!
Ad Unit ID %%ADUNITID%%
Bundle ID %%BUNDLE%%
Cache Buster %%CACHEBUSTER%%
Click URL (Escaped) %%CLICK_URL_ESC%%
Click URL (Unescaped) %%CLICK_URL_UNESC%%
Creative ID %ecid!
Destination URL (Double Escaped) %%DEST_URL_ESC_ESC%%
Destination URL (Escaped) %%DEST_URL_ESC%%
Destination URL (Unescaped) %%DEST_URL%%
Device ID %eudid!
Do Not Track %%DNT%%
IP Address %%IPADDRESS%%
Keywords %%KEYWORDS%%
Keywords (specific key) %%KEYWORD:[key]%%
Latitude %%LATITUDE%%
Longitude %%LONGITUDE%%
Placement ID (App ID) %%PLACEMENTID%%
Request ID %%REQUESTID%%
User Agent %%USERAGENT%%

Notes about Macros

  • If you’re passing over key value pairs, you can set a macro to return the value for a particular key using the %%KEYWORD:[key]%% macro. Example: If you’re passing over “gender:male,age:24” as your keywords, you can use the %%KEYWORD:age%% macro to pass the age into your ad. %%KEYWORD:age%% will be replaced with 24
  • Cachebusters are noted by &ord= parameters.
  • If your HTML ad is using an anchor tag (<a href>) or window.location redirect, our SDK automatically tracks clicks
  • The %%CACHEBUSTER%% macro returns UNIX timestamp in milliseconds
  • Device IDs can be one of the following: IDFA, Android Advertising ID (if Google Play Services is integrated) or SHA1 Hashed Android ID
  • The %%DNT%% macro returns 0 for no opt out or 1 for opt out (do-not-track)
  • The Request ID is a unique ID assigned to each ad request

Last updated September 16, 2018

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2018 MoPub Inc.