サイトのトップへ戻る

Twitter 開発者 ドキュメント日本語訳

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 Unt ID: %%ADUNITID%%
  • Placement ID (appID for in-app, siteID for mobile-web): %%PLACEMENTID%%
  • 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%%
  • DNT (device-level do-not-track setting, 0 or 1): %%DNT%%
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 (<a href>) 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>