Skip to main content
Macros Overview

What macros can I use for 3rd party ad server tags and click and impression trackers?

Cindy avatar
Written by Cindy
Updated this week

Macros are dynamic placeholders within a URL, such as a pixel tracker or click URL, that automatically populates with specific values when an ad is served. They allow for real-time data insertion, such as campaign IDs, publisher names, or user device information, enabling precise tracking and reporting. When the ad delivers, an event happens, or a user interacts with the ad, the implemented macro is replaced by the actual value.

AdLib macros must be embedded (e.g., [CAMPAIGN_ID]) into the URL's query parameters and should always be placed between squared brackets [].
For example, a URL might look like: example.com/?campaign=[CAMPAING_ID]&publisher=[DOMAIN]

Important:
When using 3rd party display creatives (ad tags), it's mandatory to implement the click macro ([CLICK_URL] or [CLICK_URL_ESC]) on the ad tag for clicks to be properly tracked in all platforms. Not including it won't affect the click-through or the creative to be displayed, but it will result in 0 clicks registered in AdLib.
The ad server must provide orientation regarding the correct macro and position on the tag for it to be implemented.
For example, on Google <ins> tag:
<ins class='dcmads' style='display:inline-block;width:160px;height:600px'
data-dcm-placement='N7051.150331.MPI/B32869015.418406739'
data-dcm-rendering-mode='iframe'
data-dcm-https-only
data-dcm-ltd='false'
data-dcm-click-tracker='[CLICK_URL]'
data-dcm-resettable-device-id=''
data-dcm-app-id=''>
<script src='https://www.googletagservices.com/dcm/dcmads.js'></script>
</ins>

AdLib Macro

AdLib Definition

[CLICK_URL]

Click macro to be applied on the 3rd party ad tag

[CLICK_URL_ESC]

Escaped click macro to be applied on the 3rd party ad tag

[CACHEBUSTER]

Cachebuster use - replaced it by a random number to avoid cache in browsers/servers

[AUCTION_ID]

Unique ID for every events associated with the bid request

[TIMESTAMP]

Timestamp of the bid time

[BIDREQ]

Ad-request ID provided by exchanges

[CONTEXTUAL]

Intersection (overlap) of ID between the contextual segments in the bid request and the contextual segments targeted by the strategy.

[CAMPAIGN_ID]

Campaign ID

[CAMPAIGN_NAME]

Campaign Name

[ADVERTISER_ID]

Advertiser ID

[ADVERTISER_NAME]

Advertiser Name

[CREATIVE_ID]

Creative ID

[CREATIVE_NAME]

Creative Name

[CREATIVE_TYPE]

Creative Type

[WIDTH]

Creative width

[HEIGHT]

Creative height

[SEGMENT]

Will pass the ID of targeted segments of the current (selected) strategy.

[DEVICE_MAKE]

The device make that the ad was served on

[DEVICE_MODEL]

The device model that the ad was served on

[DEVICE_TYPE]

The type of device the impression was served on.

[PLATFORM_OS]

Operating system of the device the ad was served on

[PLATFORM_OS_VERSION]

The version of the operation system of the device the ad was served on

[PLATFORM_CARRIER]

Mobile carrier of the device the ad was served on

[LANGUAGE]

Device language

[SKAN_VERSION]

SKAdnetwork version

[SKAN_CAMPAIGN_ID]

SKAdnetwork campaign ID

[PAGE]

The full URL of the page the ad was served on

[DOMAIN]

Domain the impression was served on

[SITE_ID]

Site ID that the impression was served on

[SITE_NAME]

Site Name that the impression was served on

[APP_BUNDLE]

Mobile application bundle the impression was served on

[APP_NAME]

Mobile application name the impression was served on

[APP_STORE_URL]

URL the mobile application on the app store

[PUBLISHER_ID]

Publisher ID for the impression reported by the exchange.

[INVENTORY_SOURCE]

Exchange inventory source

[COUNTRY_CODE]

Two-character country code of the device/user.

[LAT]

The latitude of the device/user

[LONG]

The longitude of the device/user

[METRO_CODE]

The metro code of the device/user. Metro code is the OpenRTB equivalent of DMA.

[ZIP_CODE]

The zip code of the device/user.

[CITY_CODE]

The city of the device/user, using United Nations Code for Trade and Transport locations, as defined in the oRTB spec for the geo.city object.

[REGION]

The state/region of the device/user. In the US, this is the state code

[GDPR_CONSENT_STRING]

The consent string on the bid request used for GDPR compliance.

[IS_GDPR]

Whether the auction is subject to GDPR.

[IS_GDPR_CONSENTED]

Whether the auction is regulated by GDPR AND the customer has been granted consent by the end user

[US_PRIVACY_STRING]

The US Privacy String on the bid request used for CCPA compliance.

[IS_COPPA]

Whether the auction is subject to COPPA

[USER_ID]

Device ID for mobile / Cookie for desktop

[USER_ID_SHA1]

Device ID for mobile, hashed

[USER_AGENT]

Device user agent

[USER_AGENT_ESC]

Device user agent escaped

[IP_ADDRESS]

IPv4 address

[IP_ADDRESS_IPV6]

IPv6 address

[IP_ADDRESS_ESC]

IPv4 address URL escaped

[ANDROID_ID]

Android device id

[IOS_ID]

Apple device iD

Related Articles: Adding Creative or Ad Tags

Have more questions? Message us directly in the App!

Did this answer your question?