Advertising DSP Macros
A macro is a short command or shorthand for an instruction and usually follows the format ${MACRO_NAME}
. Macros included in creative code or click-through URLs expand into a longer code string that the ad server can understand. The DSP ad server executes macros when the ad is served or clicked.
Ad server macros are useful for passing important information to DSP or to third-party ad servers. Macros are most commonly used during trafficking of third-party and custom creative code or metadata (such as third-party pixels).
You can manually insert a macro anywhere, such as in a VAST tag, in any URL, or in a DSP or third-party event pixel. However, each DSP client and partner has a different ad tag format, and the macros should be inserted in different spots in the tag accordingly. Each time you work with a new client or partner, ask them for documentation on where to insert the macros in their ad tags that DSP traffics.
General Tracking Macros
Use general tracking macros across all ad and tag types to pass back specific data, as required.
${TM_ACCOUNT_ID}
${TM_AD_ID}
${TM_AD_ID_NUM}
${TM_ADVERTISER_ID}
${TM_CAMPAIGN_ID}
${TM_CAMPAIGN_ID_NUM}
${TM_CLICK_URL}
${TM_CLICK_URL_URLENC}
${TM_FEED_ID}
${TM_FEED_ID_NUM}
${TM_MACRO_PLACEMENT_SITE_KEY
${TM_PLACEMENT_ID}
${TM_PLACEMENT_ID_NUM}
${TM_RANDOM}
${TM_SESSION_ID}
${TM_SITE_DOMAIN_URLENC}
${TM_SITE_NAME}
${TM_SITE_URL_URLENC}
${TM_SITE_ID_NUM}
${TM_TIMESTAMP}
${TM_VIDEO_DURATION}
Mobile-Specific Macros
${CS_PLATFORM_ID}
(ComScore) The platform ID, which corresponds to the device鈥檚 operating system:
ios
= Apple iOSandroid
= Google Androidwindows
= Windows Mobileblackberry
= Blackberryother
when the platform is none of the above
${CS_DEVICE_MODEL}
${CS_IMPLEMENTATION_TYPE}
(ComScore) The environment in which the ad was served:
a
= mobile applicationb
= mobile website
a
or b
)${NS_PLATFORM_ID}
(Nielsen) The platform ID, which corresponds to the device鈥檚 operating system:
ios
= Apple iOSandroid
= Google Androidwindows
= Windows Mobileblackberry
= Blackberryother
when the platform is none of the above
${NS_DEVICE_GROUPING}
(Nielsen) The the device type on which the ad was viewer:
TAB
= tabletPHN
= mobilecomputer
= computer
${UOO}
(Nielsen) Whether or not the user has opted out of ad tracking:
1
(DNT flag = 1) = the user has opted out of ad tracking0
(DNT flag = 0) = the user has opted in to ad tracking
0
or 1
)${TM_BUNDLE}
gdpr=${GDPR_ENFORCED}&gdpr_consent=${GDPR_CONSENT}
gdpr=${GDPR_ENFORCED}
indicates if the bidder determines that the bid request comes from the European Union origin and requires GDPR enforcement:
1
= GDPR should be enforced0
= GDPR should not be enforced
gdpr_consent=${GDPR_CONSENT}
is the consent value passed from the supply partner in the inbound bid request:
- In most cases, this is a base64url-encoded consent string, or daisybit (example: BN5lERiOMYEdiAKAWXEND1HoSBE6CAFAApAMgBkIDIgM0AgOJxAnQA)
0
= no consent1
= consent
Click Macros for Third-Party Display Ads
To accurately track clicks for ads using third-party display tags, DSP requires a display click macro. Only one version of the macro is required; the relevant macro depends on the type of tag.
${TM_CLICK_URL}
${TM_CLICK_URL_URLENC}
DSP automatically inserts display click macros in a third-party display tag when you:
- Export ad tags from an ad server partner
- Bulk upload Flashtalking or Google DoubleClick for Advertisers ad tags directly in DSP
If a click macro is missing when you build a display ad, DSP displays a warning message, which prompts you to manually insert the appropriate display click macro in the correct area of the tag.
Analytics for Advertising Macros
For additional macros available specifically for Analytics for Advertising customers, see 鈥Append Analytics for Advertising Macros to Flashtalking Ad Tags鈥 and 鈥Append Analytics for Advertising Macros to Google Campaign Manager 360 Ad Tags.鈥
Troubleshooting Macro Errors
When you add macros to your code, make sure you use the exact syntax of the macro. When validating the macros, DSP checks that the macro exactly matches one of the valid macros.
Errors are generated if characters are missing from the beginning or end of the macro name. For example, an error message is shown if:
- You forget one or more of the characters at the beginning of the macro name, such as
${
. If you don鈥檛 include the full syntax, the entry isn鈥檛 recognized as a valid macro. - The macro doesn鈥檛 end with a valid set of characters, such as
}
.