Supported Ad-Serving Macros

Greta
Greta
  • Updated

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

__ADFADV__

Advertiser name

__ADFADVID__

Advertiser ID

Banner

__ADFBANGROUPx__

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. 

__ADFBANGROUPxID__

ID of a banner group number x (x=1 to 5)

__ADFCRE__

Creative banner name

__ADFCREID__

Creative banner ID

__ADFDIM__

Creative banner dimensions as width x height in pixels (for example, 300x250)

__ADFHEIGHT__

Creative banner height in pixels

__ADFTYP__

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.)

__ADFWIDTH__

Creative banner width in pixels

__ADFADMSGID__

AdMessage ID (Only for simple Dynamic Ads)

Campaign

__ADFCAM__

Campaign name

__ADFCAMID__

Campaign ID

__ADFLABELx__

Campaign label number x (x=1 to 20)

Inventory

__ADFBNRDOM__

The domain where the banner was shown (except in-stream ads)

This is the web page's URL with the domain and any subdomains. 

__ADFINV__

Inventory source name (only available for ads served with RTB)

__ADFINVID__

Inventory source ID (only available for ads served with RTB)

__ADFRTBDOM__

RTB domain (only available for ads served with RTB)

This macro provides only the domain where the ad was shown.

Inventory (Mobile App)

__ADFAPPDATA__

Application data (only available for ads served with RTB that triggered a mobile app download)

__ADFPUBID__

External publisher ID (only available for ads served with RTB that triggered a mobile app download)

__ADFAPPID__

Mobile app bundle ID (only available for ads served with RTB in an mobile app environment)

__ADFAPPNAME__

Mobile application name (only available for ads served with RTB in an mobile app environment)

Inventory (Placement)

__ADFPLA__

Placement name

__ADFPLAID__

Placement ID

__ADFPLASEC__

Placement section name

__ADFPLALBLx__

Placement label number x (x=1 to 20)

Inventory (PMP)

__ADFDPID__

Deal ID (only available for ads served with RTB in an mobile app environment)

Landing Page

__ADFLP__

Encoded landing page URL (only for landing page or click URLs and for click-tracking pixels)

Line Item

__ADFADGAPID__

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

__ADFMED__

Media name (only available for DSP and Publisher Ad Server)

__ADFMEDID__

Media ID (only available for DSP and Publisher Ad Server)

__ADFNETW__

Media network name (only available for DSP and Publisher Ad Server)

__ADFNETWID__

Media network ID (only available for DSP and Publisher Ad Server)

Order

__ADFORD__

Order name

__ADFORDID__

Order ID

Tag

__ADFTAGID__

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.

__ADFTAGNAME__

Adform tag name (only available for DSP and Publisher Ad Server)

Technical

__ADFIMPID__

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.

__ADFM<pattern>__

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.

__ADFSEP__

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_BASE_URL__

Comscore-specific replace (‘https://sb’ or ‘http://b’)

__ADFTIMESTAMP__

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.

__ADFTRID__

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

__ADFOPTSTAT__

GDPR opt-out status

This relates to the GDPR overlay with 1 = opted out; 0 = opted in.

__ADFGDPR__

GDPR flag according to IAB TCF

Indicates whether GDPR applies with values with 1 = GDPR applies; 0 = GDPR doesn't apply.

__ADFGPPSID__

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

__ADFGPPSTRING__

User’s Consent string according to IAB Global Privacy Platform (GPP)

__ADFGDPRCONSENT__

Consent DaisyBit information according to IAB TCF

User Context

__ADFUID__

Adform user ID (cookie ID)

__ADFREFERER__

Referrer URL (uses the page’s URL truncated to 400 characters)

__ADFDEVID__

Mobile advertising ID (IDFA or AAID)

__ADFLAT__

Latitude of the viewer’s location

__ADFLNG__

Longitude of the viewer’s location

__ADFCITY__

City of the viewer's location

__ADFCOUNTRY__

Country of the viewer's location

__ADFREGION__

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.

Was this article helpful?

/
How we can make it better?

Thank you for your feedback!