Demand partners
LoopMe Macros

LoopMe Macros

Introduction

Macros are strings of text that the LoopMe ad server replaces at the moment of ad serving. Macros can be used in impression & click tracking links, VAST tags and ad HTML.

Macros are case-sensitive. For example, %%CACHEBUSTER%% works, but %%Cachebuster%% doesn't.

Click & Impression Tracking Macros

Our click and impression macros can be added to a campaign's click through URL or 3rd party impression impression tracking link. The macros string will be replaced with a value when the ad is served to the user.

Example: The click macro {ad_delivery_token} in the clickthrough URL below:

 itunes.apple.com/us/app/cool-race-free-by-top-free/id510064027?mt=8&tid=\{ad_delivery_token\}
 ```

will be replaced with a unique click ID value in the actually redirect link:
https://itunes.apple.com/us/app/cool-race-free-by-top-free/id510064027?mt=8&tid=00000000-0000-0000-0000-000000000000
```

Unique Ad ID Macro

MacroDescription
{ad_delivery_token} or {ADID} or {adid}This text string is replaced by the unique ID assigned to the ad creative being served.

The user device ID macro is replaced with the Google Advertiser ID (GAID) is returned in case of Android device and Apple's ID for Advertiser (IDFA) in case of IOS device.

Cachebuster & Timestamp Macro

MacroDescription
{timestamp} or {cachebuster}This text string is replaced by a unix timestamp

The cachebuster macro ensures that a fresh call is made to the ad server every time the click or impression URL is executed, so you’re accurately counting impressions. If you don't add the cache-busting macro to the creative code, you’re more likely to see impression counting discrepancies between LoopMe and a third-party ad server. Note that not all third parties require the cachebuster macro.

Example:

 http://abc.3rd-party-serving.com/Targeting/adServer.php?ab=cd&e=12fg=click&ord=%%CACHEBUSTER%%

If you are unsure of how to place cachebuster macros properly in your third-party creatives, please contact the vendor that created your creatives.

User or Device ID Macro

MacroDescription
{device_id} or {udid} or {viewer_token}This text string is replaced by the user's device ID.
{md5_device_id}This text string is replaced by the user's device ID, encrypted using MD5
{sha1_device_id}This text string is replaced by the user's device ID, encrypted using SHA1
{user_consent}This text string is replaced by the user's explicit GDPR consent, according to the EU GDPR regulations(TCF v1)
${US_PRIVACY}This text string is replaced by the user's CCPA consent, according to the CCPA regulations
${GDPR}This text string is replaced by the GDPR value(0/1) in order to indicate whether GDPR applies or not (TCF v2)
${GDPR_CONSENT_109}This text string is replaced by the URL-safe base64-encoded "Transparency & Consent string" (TCF v2)
${ADDTL_CONSENT}This text string is replaced by the list of consented Google Ad Tech Providers (Google consent Framework)

The user device ID macro is replaced with the Google Advertiser ID (GAID) is returned in case of Android device and Apple's ID for Advertiser (IDFA) in case of IOS device.

Originating IP Address Macro

MacroDescription
{ip_address}This text string is replaced by the ip address of the users handset.

Creative Macros

MacroDescription
{creative_token}This text string is replaced by the unique ID for the ad creative served.
{creative_id}This text string is replaced by the LoopMe ID for the ad creative served.
{creative_name}This text string is replaced by the name label for the ad creative served.
{creative_type}This text string is replaced by the type label for the ad creative served. Supported values: video, html, static.
{adformat}This text string is replaced by the ad format label for the ad creative served.
{pricing}This text string is replaced by the pricing model used for the ad creative served. Supported value: cpc, cpi, cpm, cpcv.

Line Item Macros

MacroDescription
{li_id}This text string is replaced by the LoopMe line item ID for the ad creative served.
{li_name}This text string is replaced by the line item name label for the ad creative served.

Campaign Macros

MacroDescription
{camp_id}This text string is replaced by the LoopMe campaign ID for the ad creative served.
{camp_name}This text string is replaced by the campaign name label for the ad creative served.
{camp_type}This text string is replaced by the LoopMe campaign type for the ad creative served.

Advertiser ID Macros

MacroDescription
{advertiser_token}This text string is replaced by the account ID number of the advertiser for the ad creative served.

App and Publisher Macros

MacroDescription
{app_key}This text string is replaced by the unique ID for the registered app or site the ad is served in.
{publisher_id}This text string is replaced by the unique account ID for the registered publisher the ad is served in.
{bundle_domain}This text string is replaced by the app's bundle ID (example: air.dj.brothersandring.mobile.android.BrothersAndRingGoogle) or the site's domain (example: bmw.com)
{media_type}This text string is replaced by the Media Type (e.g Website)
{page_url}This text string is replaced by the Page URL
{exchange}This text string is replaced by the exchange used to serve the ad. (example: mopub_rtb, loopme)

Ad Type Macro

MacroDescription
{ad_type}This text string is replaced by the ad type used to serve the advertisement.

Connection Type Macro

MacroDescription
{connection_type}This text string is replaced by the connection type used to serve the advertisement.

Carrier Macro

MacroDescription
{carrier}This text string is replaced by the carrier name used to serve the advertisement.

Country Code Macro

MacroDescription
{country_code}This text string is replaced by the 2 letter country code when the advertisement was served.

City Name Macro

MacroDescription
{city_name}This text string is replaced by the city name where the advertisement was served.

ZIP code Macro

MacroDescription
{zip}This text string is replaced by the zip coe where the advertisement was served.

Do Not Track Macro

MacroDescription
{dnt}This text string is replaced by the do not track value for the user.

Device Info Macro

MacroDescription
{device_os_ver}This text string is replaced by device OS version of the user.
{device_os}This text string is replaced by device OS type of the user.
{device_make}This text string is replaced by device manufacturer of the user.
{device_type}This text string is replaced by device type of the user.
{device_id_type}This text string is replaced by device ID type of the user.
{viewtoken_id_type}This text string is replaced by device type token ID.

Time of Day Macro

MacroDescription
{time_of_day}This text string is replaced by the UTC hour when the ad was served

GEO code Macro

MacroDescription
{lon}This text string is replaced by the longitude where the advertisement was served.
{lat}This text string is replaced by the longitude where the advertisement was served.
{h_lon}This text string is replaced by a validated handset longitude where the advertisement was served.
{h_lat}This text string is replaced by a validated handset latitude where the advertisement was served.

HTML Ad Macros

HTML Ad macros can be used in the HTML code of rich media ads. The macro strings in the ad HTML will be replaced by actual values at the moment of ad serving.

Cachebuster & Timestamp Macro

MacroDescription
%%CACHEBUSTER%% or %%TIMESTAMP%%This text string is replaced by a unix timestamp

The cachebuster macro ensures that a fresh call is made to the ad server every time the code is executed, so you’re accurately counting impressions. If you don't add the cache-busting macro to the creative code, you’re more likely to see impression counting discrepancies between LoopMe and a third-party ad server. Note that not all third parties require the cachebuster macro.

Example:

http://abc.3rd-party-serving.com/Targeting/adServer.php?ab=cd&e=12fg=click&ord=\%%CACHEBUSTER\%%

If you are unsure of how to place cachebuster macros properly in your third-party creatives, please contact the vendor that created your creatives.

User or Device ID Macro

MacroDescription
%%UDID%%This text string is replaced by the user's device ID.
%%MD5UDID%% or %%MD5_DEVICE_ID%%This text string is replaced by the user's MD5 encrypted device ID.
%%USER_CONSENT%%This text string is replaced by the user's explicit GDPR consent signal, according to the EU GDPR regulations.
${US_PRIVACY}\This text string is replaced by the user's CCPA consent signal, according to the CCPA regulations.
%%MEDIA_TYPE%%This text string is replaced by the user's platform type: ios, android, website, desktop

The user device ID macro is replaced with the Google Advertiser ID (GAID) is returned and in case of IOS, Apple's ID for Advertiser (IDFA) is returned.

3rd Party Tracking Macros

MacroEscapingDescription
%%CLICK_URL%% or %%CLICK_URL_UNESC%%EscapedThis text string is replaced by an escaped (or unescaped) click tracking URL.
%%CLICK_URL_ESC%%EscapedThis text string is replaced by an escaped (URL encoded) click tracking URL.
%%IMPRESSION_URL%% or %%VIEW_URL_UNESC%%EscapedThis text string is replaced by escaped (or unescaped) impression tracking URL

A click macro allows you to track clicks on third-party creatives.

Do not enter the click macro as the source of an image or iframe. Doing so results in a click being recorded every time the image or iframe renders, which is not legitimate and is filtered out as an invalid click.

An impression macro allows advertisers to track impressions for third-party creatives.

Enter the advertiser's impression tracking macro in the "Impression URL" field for the creative, the impression macros in the ad HTML will be replaced with the value entered in the Impression URL field upon serving of the ad.

Unique Ad ID Macro

MacroDescription
%%ADID%%This text string is replaced by the unique ad ID, generated upon ad serving.

Creative Info Macro

MacroDescription
%%CREATIVEID%%This text string is replaced by the unique ID for the ad creative served.
%%CAMP_ID%%This text string is replaced by the campaign ID for the ad creative served.
%%ADVERTISER%%This text string is replaced by the name of the advertiser for the ad creative served.
%%IS_STRETCHED%%This text string is replaced by the is stretched value for the ad creative served.

App ID and Publisher ID Macros

MacroDescription
%%APPID%% or %%APP_ID%%This text string is replaced by the unique ID for the registered app or site the ad is served in.
%%APP_NAME%%This text string is replaced by the name of the app or site the ad is served in.
%%BUNDLE_DOMAIN%%This text string is replaced by the bundle ID or site domain of the app or site the ad is served in.
%%PUBID%%This text string is replaced by the unique ID for the registered publisher the ad is served in.
%%EXCHANGE%%This text string is replaced by the exchange name (RTB) where the ad is served in.

Ad creative image Macros

MacroDescription
%%IMAGE_URL%%This text string is replaced with the download URL for the sample image for an HTML creative, upload in the creative upload page for HTML ads.

GEO code Macro

MacroDescription
%%ZIP%%This text string is replaced by the zip code where the advertisement was served.
%%LON%%This text string is replaced by the longitude where the advertisement was served.
%%LAT%%This text string is replaced by the latitude where the advertisement was served.

VAST URL Macros

VAST URL Macros are used to dynamically replace values in the VAST URL when called.

Cachebuster & Timestamp Macro

MacroDescription
{timestamp} or {cachebuster}This text string is replaced by a unix timestamp

The cachebuster macro ensures that a fresh call is made to the ad server every time the click or impression URL is executed, so you’re accurately counting impressions. If you don't add the cache-busting macro to the creative code, you’re more likely to see impression counting discrepancies between LoopMe and a third-party ad server. Note that not all third parties require the cachebuster macro.

Example:

    http://abc.3rd-party-serving.com/Targeting/adServer.php?ab=cd&e=12fg=click&ord=\%%CACHEBUSTER\%%
    ```

If you are unsure of how to place cachebuster macros properly in your third-party creatives, please contact the vendor that created your creatives.

### User or Device ID Macro

| Macro               | Description                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------------------- |
| \{device_id\}         | This text string is replaced by the user's device ID.                                                         |
| \{md5_device_id\}     | This text string is replaced by the user's device ID, encrypted using MD5                                     |
| \{sha1_device_id\}    | This text string is replaced by the user's device ID, encrypted using SHA1                                    |
| \{user_consent\}      | This text string is replaced by the user's explicit GDPR consent, according to the EU GDPR regulations        |
| $\{US_PRIVACY\}       | This text string is replaced by the user's CCPA consent, according to the CCPA regulations                    |
| $\{GDPR\}             | This text string is replaced by the GDPR value(0/1) in order to indicate whether GDPR applies or not (TCF v2) |
| $\{GDPR_CONSENT_109\} | This text string is replaced by the URL-safe base64-encoded "Transparency & Consent string" (TCF v2)          |
| $\{ADDTL_CONSENT\}    | This text string is replaced by the list of consented Google Ad Tech Providers (Google consent Framework)     |

The user device ID macro is replaced with the Google Advertiser ID (GAID) is returned in case of Android device and Apple's ID for Advertiser (IDFA) in case of IOS device.

### App Info and Publisher ID Macros

| Macro               | Description                                                                                       |
| ------------------- | ------------------------------------------------------------------------------------------------- |
| \{app_key\}           | This text string is replaced by the unique ID for the registered app or site the ad is served in. |
| \{publisher_id\}      | This text string is replaced by the unique ID the ad is served in.                                |
| \{publisher_token\}   | This text string is replaced by the unique ID for the registered publisher the ad is served in.   |
| \{app_name\}          | This text string is replaced by the app name the ad is served in.                                 |
| \{audience_gender\}   | This text string is replaced by the audience gender.                                              |
| \{publisher_name\}    | This text string is replaced by the publisher name the ad is served in.                           |
| \{show_close_button\} | This text string is replaced by the show close button value for the user.                         |
| \{is_autoplay\}       | This text string is replaced by the is app autoplay value for the user.                           |
| \{is_muted\}          | This text string is replaced by the is app muted value for the user.                              |
| \{skip_button_delay\} | This text string is replaced by the app skip button delay value for the user.                     |
| \{exchange\}          | This text string is replaced by the app exchange value for the user.                              |

### Campaign info

| Macro           | Description                                        |
| --------------- | -------------------------------------------------- |
| \{camp_name\}     | This text string is replaced by the campaign name. |
| \{creative_name\} | This text string is replaced by the creative name. |
| \{li_name\}       | This text string is replaced by the lineitem name. |

### Originating IP Address Macro

| Macro        | Description                                                          |
| ------------ | -------------------------------------------------------------------- |
| \{ip_address\} | This text string is replaced by the ip address of the users handset. |

### User Agent Macro

| Macro        | Description                                                                       |
| ------------ | --------------------------------------------------------------------------------- |
| \{user_agent\} | This text string is replaced by the user agent of the device the ad is served to. |

### GPS Coordinates Macros

| Macro | Description                                                                                   |
| ----- | --------------------------------------------------------------------------------------------- |
| \{lon\} | This text string is replaced by the longitude of the user's handset. E.g. "-0.1427039"        |
| \{lat\} | This text string is replaced by the latitude of the user's handset. E.g. "51.517159899999996" |

### App Bundle or Site Domain Macro

| Macro           | Description                                                                                                                                                        |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| \{bundle_domain\} | This text string is replaced by the app's bundle ID (example: air.dj.brothersandring.mobile.android.BrothersAndRingGoogle) or the site's domain (example: bmw.com) |
| \{db_bundle_id\}  | This text string is replaced by the DB bundle ID                                                                                                                   |

### Do Not Track Macro

| Macro | Description                                                          |
| ----- | -------------------------------------------------------------------- |
| \{dnt\} | This text string is replaced by the do not track value for the user. |
|  |

### API Name Macro

| Macro      | Description                                   |
| ---------- | --------------------------------------------- |
| \{api_name\} | This text string is replaced by the API name. |

### Video Size Macro

| Macro    | Description                                      |
| -------- | ------------------------------------------------ |
| \{width\}  | This text string is replaced by the video width  |
| \{height\} | This text string is replaced by the video height |