How mopub manages its macros?

868 Views Asked by At

i'm developing an app that works with a tag, like mopub does. But i can't found how mopub manages his macros. In other words, my app will read a JavaScript tag and will process the tag in the app. For this reason i need help to know how does mopub do for manage the macros.

1

There are 1 best solutions below

0
On BEST ANSWER

MoPub Macros

MoPub supports the following macros for a publisher’s 3rd party ad tags and trackers:

  • Click URL (Unescaped): %%CLICK_URL_UNESC%%
  • Click URL (Escaped): %%CLICK_URL_ESC%%
  • Cache Buster (Generates a random number): %%CACHEBUSTER%%
  • Ad Group ID: %eaid!
  • Creative ID: %ecid!
  • Destination URL: %%DEST_URL%%
  • Destination URL (Escaped): %%DEST_URL_ESC%%
  • Destination URL (Double Escaped): %%DEST_URL_ESC_ESC%%
  • IDFA, SHA1 Hashed Android ID, or Android Advertising ID (if Google Play Services is integrated): %eudid!
  • Keywords: %%KEYWORDS%%
  • Specific Key Value: %%KEYWORD:[key]%% (replace [key] with the parameter you want to return the value for)
  • Latitude: %%LATITUDE%%
  • Longitude: %%LONGITUDE%%

Notes about Macros:

If you’re passing over key value pairs, you can set a macro to return the value for a particular key. e.g. 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

If you are using a mobile web tag, you can manually pass up UDID through the UDID macro if it is being passed from another server (ie. DFP) Cachebusters are noted by &ord= parameters.

If your HTML ad is using an anchor tag () or window.location redirect, our SDK automatically tracks clicks The %%CACHEBUSTER%% macro returns unix timestamp in milliseconds If you are using mobile web, your tag can support click tracking if you prepend the click tracker. To add click pending to a MoPub mobile web tag use the following setup:

<script type=”text/javascript”>// <![CDATA[
var mopub_ad_unit=’AD UNIT ID’;

//Be sure to set these to the size of your adunit
var mopub_ad_width=320; //optional
var mopub_ad_height=50; //optional
var mopub_click_prepend=’[CLICK_PREPEND_MACRO]’;

//Use custom keywords appropriate for your mobile webpage
//var mopub_keywords= “custom keywords”; //optional
// ]]></script>
<script src=”http://ads.mopub.com/js/client/mopub.js” type=”text/javascript”></script>

Source: https://dev.twitter.com/mopub/orders-line-items/macros