Macros
Macros are dynamic placeholders used within ad tags to insert real-time values when an ad is served. They help advertisers track user behavior, optimize campaign performance, and collect valuable device or contextual information. These macros are replaced by actual values at runtime and sent back to the advertiser’s system for analysis.
Important: Macros are used for tracking on the advertiser’s side only. They do not appear in DSP reporting.
How to Use Macros
To implement macros:
- Copy the ad tag.
- Add macros after a
?
in the tag URL.
- Format each macro as a key-value pair, for example:
SUB_ID=[SUB_ID]
- Separate multiple macros with an ampersand
&
.
Example:
<script src="https://site.com/creatives/main.js?dti=full&SUB_ID=[SUB_ID]&SOURCE_ID=[SOURCE_ID]&CARRIER=[CARRIER]"></script>
Note: Only use macros from the official list below. Macros are case-sensitive.
Campaign & Creative Macros
Macro |
Description |
Example |
[ADVERTISER_ID] |
Unique advertiser ID |
Numeric digits like 102934 |
[CAMPAIGN_ID] |
Campaign ID |
Numeric digits like 8342 |
[CREATIVE_ID] |
Creative ID |
Numeric digits like 50988 |
[CREATIVE_NAME] |
Name of the creative |
- |
[SOURCE_ID] |
Source/SSP partner ID |
- |
[SUB_ID] |
Unique request ID |
- |
[PUBLISHER_ID] |
Publisher ID |
- |
[TAG_ID] |
Ad tag/placement ID |
- |
User Identification Macros
Macro |
Description |
Example |
[USER_ID] |
Platform user ID |
- |
[IFA] |
Device advertising ID |
AEBE52E7-03EE-455A-B3C4-E57283966239 |
[USER_AGENT] |
Browser user agent string |
Mozilla/5.0 (Linux; Android 11; Pixel 5) |
[GENDER] |
Gender of user |
M, F, O, or none |
Privacy & Consent Macros
Macro |
Description |
Example |
[DNT] |
Do Not Track setting |
1 = don’t track, 0 = allow |
[LMT] |
Limit Ad Tracking |
1, 0 |
[GDPR] |
Indicates if GDPR applies |
1 = yes |
[GDPR_CONSENT] |
Consent string |
BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA |
[GPP_SID] |
GPP section ID |
7 |
[GPP_STRING] |
GPP string |
DBABMA\~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAQABgAAAAA |
Device & Environment Macros
Macro / Alt Names |
Description |
Example |
[OS] / {DEVICE_OS_NAME} |
Operating system |
iOS, Android |
[OSV] / {DEVICE_OS_VERSION} |
OS version |
14.5, 11 |
[MODEL] |
Device model |
iPhone 12 |
[DEVICE_MAKE] / {MANUFACTURER_NAME} |
Device manufacturer |
Apple, Samsung |
[DEVICETYPE] / {DEVICE_TYPE} |
Type of device |
mobile, tablet |
[BROWSER] |
Browser name |
Chrome, Safari |
[BROWSER_VER] |
Browser version |
112.0.0.0 |
[DEVICE_LANG] |
Device language |
en-US |
[WIDTH] |
Ad width in px |
300 |
[HEIGHT] |
Ad height in px |
250 |
[INSTL] |
Interstitial ad (1 = yes) |
0 |
[CONNECTIONTYPE] |
Network type |
4, 5 (for WiFi, 4G, etc.) |
[SECURE] |
HTTPS? (1 = yes) |
1 |
Location & Network Macros
Macro |
Description |
Example |
[IP] |
User’s IP address |
192.168.1.1 |
[COUNTRY] |
Country code |
US, DE, UA |
[REGION] |
Region code |
CA (California) |
[CITY] |
City name |
San Francisco |
[CARRIER] |
Mobile carrier |
Verizon, T-Mobile |
Site, App, and Page Macros
Macro |
Description |
Example |
[APP_BUNDLE] |
App bundle ID |
com.company.app |
[APP_NAME] |
App name |
MyCoolApp |
[SITE_APP_ID] |
ID of the site/app |
site_2384 |
[SITE_NAME] |
Name of the site |
newsportal.com |
[SITE_DOMAIN] |
Domain |
example.com |
[SITE_DOMAIN_APP_NAME] |
Site domain or app name |
example.com or AppName |
[SITE_APP_URL] |
Store/site URL |
https://apps.apple.com/app/id123456 |
[PAGE_URL] |
Full page URL |
https://example.com/sports |
[SITE_PAGE] |
Page URL (alias) |
same as above |
[SOURCE] |
Web domain or bundle |
com.example.app |
[IAB_CAT] |
IAB categories |
IAB1-3,IAB2-10 |
Ad Format & Video Macros
Macro |
Description |
Example |
[REQUEST_TYPE] |
Request format: banner, native, video |
video |
[API] |
Supported APIs |
2 (e.g., MRAID 2.0) |
[POS] |
Ad position |
1 = above the fold |
[VIDEO_MIME] |
MIME types for video |
video/mp4 |
[PROTOCOLS] |
Supported protocols |
2,3,5 |
[MINIMUM_DURATION] |
Min video duration (s) |
5 |
[MAXIMUM_DURATION] |
Max video duration (s) |
30 |
Timestamp & Internal Macros
Macro |
Description |
Example |
[DATE_TIME] |
Timestamp (human) |
2025-04-16 14:55:32 |
[TIMESTAMP] |
UNIX timestamp (ms) |
1713273332000 |
[CLICK_ID] |
Unique click ID |
abc-123-xyz |
[HASH] |
Hashed value from click |
xyz |
Full Example with Macros
<script src="https://site.com/ad.js?PUBLISHER_ID=[PUBLISHER_ID]&IAB_CAT=[IAB_CAT]&IFA=[IFA]&GDPR=[GDPR]&GDPR_CONSENT=[GDPR_CONSENT]"></script>
When this tag is served, the placeholders (e.g., [IFA]
, [GDPR]
) will be dynamically replaced with real-time data like:
<script src="https://site.com/ad.js?PUBLISHER_ID=12345&IAB_CAT=IAB1-3&IFA=abc123xyz&GDPR=1&GDPR_CONSENT=BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA"></script>
Best Practices
- Double-check capitalization – macros are case-sensitive.
- Combine macros thoughtfully to avoid malformed URLs.
- Use only from the official macro list above.