A macro is a placeholder that gets replaced with specific characters depending on the context.
Macros help to transition information from the Adform system into ads, third-party systems (through impressions or click trackers), or to an advertiser’s page. Macros can provide information to identify or categorize ad delivery, actual impressions (or clicks), or visits to advertiser’s landing page.
Adform macros can be used in:
-
Impression tracking pixels
-
Click tracking pixels
-
Tracking scripts
-
Landing page URLs (click URLs)
-
Third-party banners
Ad-Serving Macros
Adform provides a range of macros specifically for ad-serving situations. The description for each includes any qualifiers.
Important
All macros encode replaced values. You can use %%
(double percent) as a separator instead of __
(double underscore). (For example, macros __ADFTAGID__
and %%ADFTAGID%%
are equivalent). However, using __
avoids problems with URL encodings and other interactions.
Category |
Macro |
Description |
|
---|---|---|---|
Advertiser |
|
Advertiser name |
|
|
Advertiser ID |
||
Banner |
|
Name of a banner group number x (x=1 to 5) In the Banners section, you can Manage Banner Groups (to identify and group banners by specific features). The banner attributes can be organized into 5 groups. The macro passes the value from 1 to 5 depending on the banner group. |
|
|
ID of a banner group number x (x=1 to 5) |
||
|
Creative banner name |
||
|
Creative banner ID |
||
|
Creative banner dimensions as width x height in pixels (for example, 300x250) |
||
|
Creative banner height in pixels |
||
|
Creative banner type The value depends on the banner: Unknown, Mixed (for rotators with multiple types), Image, Link, TextLink, Keyword, RichMedia, Facebook, Synchronized, InStream, ThirdParty, Html, or NativeAd. (Flash and Dhtml no longer supported.) |
||
|
Creative banner width in pixels |
||
|
AdMessage ID (Only for simple Dynamic Ads) |
||
Campaign |
|
Campaign name |
|
|
Campaign ID |
||
|
Campaign label number x (x=1 to 20) |
||
Inventory |
|
The domain where the banner was shown (except in-stream ads) This is the web page's URL with the domain and any subdomains. |
|
|
Inventory source name (only available for ads served with RTB) |
||
|
Inventory source ID (only available for ads served with RTB) |
||
|
RTB domain (only available for ads served with RTB) This macro provides only the domain where the ad was shown. |
||
Inventory (Mobile App) |
|
Application data (only available for ads served with RTB that triggered a mobile app download) |
|
|
External publisher ID (only available for ads served with RTB that triggered a mobile app download) |
||
|
Mobile app bundle ID (only available for ads served with RTB in an mobile app environment) |
||
|
Mobile application name (only available for ads served with RTB in an mobile app environment) |
||
Inventory (Placement) |
|
Placement name |
|
|
Placement ID |
||
|
Placement section name |
||
|
Placement label number x (x=1 to 20) |
||
Inventory (PMP) |
|
Deal ID (only available for ads served with RTB in an mobile app environment) |
|
Landing Page |
|
Encoded landing page URL (only for landing page or click URLs and for click-tracking pixels) |
|
Line Item |
|
Line item AdGapID (only Buy Side) This is a custom field to have a unique tracking and measurement ID for discovering discrepancies between different ad servers. It's used to compare advertiser and publisher reports by sharing a unique ID per line item with the publisher. |
|
Media |
|
Media name (only available for DSP and Publisher Ad Server) |
|
|
Media ID (only available for DSP and Publisher Ad Server) |
||
|
Media network name (only available for DSP and Publisher Ad Server) |
||
|
Media network ID (only available for DSP and Publisher Ad Server) |
||
Order |
|
Order name |
|
|
Order ID |
||
Tag |
|
Adform tag ID (only available for DSP and Publisher Ad Server) This is the ID of the 3rd-party tag served or viewed with Adform DSP or Ad Server. Adform assigns a banner number ID to every tag created. |
|
|
Adform tag name (only available for DSP and Publisher Ad Server) |
||
Technical |
|
Impression ID This is a unique identifier for the impression event. It is generated randomly, but will be the same for all transactions after the impression. (For example, ‘clicks unload’ and ‘events’ have the same value as the impression that generate them.) This is useful for correlating these transactions. |
|
|
A custom macro that maps to adfm_<pattern> query parameters This is supported for all handlers: display impressions, video ads, mobile ADF scripts, and clicks. The number of custom macros and the length of the pattern is not validated, so keep the number of custom macros and length of the pattern short due to browsers’ URL length limitations. For an example, see __ADFM<pattern>__ Example below. |
||
|
Inserts a query string value separator ? or &. (only for a tag destination URL append) If the original redirect URL has a ?, it is replaced with &; otherwise, it replaces with a ?. The macro must be the first symbol in the append. (Adform supports only one macro per append.) |
||
|
Comscore-specific replace (‘https://sb’ or ‘http://b’) |
||
|
Unix timestamp in milliseconds This is used to add a cache buster to create a unique URL. |
||
__ADFRND__ |
Random number This is used to add a cache buster to create a unique URL. |
||
|
Site tracking setup ID (only available for DSP and Publisher Ad Server) It represents the Tracking ID available in the Site Tracking page in Adform. |
||
User Consent |
|
GDPR opt-out status This relates to the GDPR overlay with 1 = opted out; 0 = opted in. |
|
|
GDPR flag according to IAB TCF Indicates whether GDPR applies with values with 1 = GDPR applies; 0 = GDPR doesn't apply. |
||
|
GPP Section ID which Adform uses for privacy resolution. As the GPP String may encode user preferences for multiple jurisdictions, this field indicates which section of the string is applicable. Possible values: 2 = EU TCF v. 2 7 = US MSPA |
||
|
User’s Consent string according to IAB Global Privacy Platform (GPP) |
||
|
Consent DaisyBit information according to IAB TCF |
||
User Context |
|
Adform user ID (cookie ID) |
|
|
Referrer URL (uses the page’s URL truncated to 400 characters) |
||
|
Mobile advertising ID (IDFA or AAID) |
||
|
Latitude of the viewer’s location |
||
|
Longitude of the viewer’s location |
||
|
City of the viewer's location |
||
|
Country of the viewer's location |
||
|
Region of the viewer's location |
__ADFM<pattern>__ Example
With the __ADFM<pattern>__
macro you can pass certain values from the tag to the landing page. For example, Adform has a tag with the pattern: https://track.adform.net/C/?
bn=xxxxxxxx;adfm_mytestvalue=test123
. Once a visitor clicks the banner (tag), the visitor goes to the landing page where the "test123" value is passed if the landing page has the mentioned macros added to it. For example the landing page can be: https://site.adform.com/?__ADFM_mytestvalue__
. Once someone clicks the banner, the final landing page becomes: https://site.adform.com/?test123
. In this instance, Adform passes the value from the tag to the landing page.