Overview of 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 an advertiser's landing page.

Note

Some macros may transmit identifiers or other user-related values to third-party systems. Clients should ensure that the use of such macros is consistent with applicable privacy laws, contractual obligations, and any required user consent or other applicable privacy signals before transmitting user-level identifiers.

Adform macros can be used in:

  • Impression tracking pixels

  • Click tracking pixels

  • Tracking scripts

  • Landing page URLs (click URLs)

  • Third-party banners

Adform doesn't support macros in impression trackers, or external (JS) scripts for native ads tags. Measurement with third-party solutions for native ads is supported, for example, see the solution by DoubleVerify.

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.

Macro

Description

Category: Advertiser

__ADFADV__

Advertiser name

__ADFADVID__

Advertiser ID

Category: 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.

__ADFWIDTH__

Creative banner width in pixels

__ADFADMSGID__

AdMessage ID (only for simple Dynamic Ads)

Category: Campaign

__ADFCAM__

Campaign name

__ADFCAMID__

Campaign ID

__ADFLABELx__

Campaign label number x (x=1 to 20)

Category: 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.

__ADFPAGEURL__

Full page URL from the bid request (URL-encoded)

Category: 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)

Category: Inventory (Placement/Line Item)

__ADFPLA__

Placement name

__ADFPLAID__

Placement ID (same as line item ID)

__ADFPLASEC__

Placement section name

__ADFPLALBLx__

Placement label number x (x=1 to 20) at line item level

Category: Inventory (PMP)

__ADFDPID__

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

Category: Landing Page

__ADFLP__

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

__ADFTPC_*__

Third-Party Click ID (TPC ID)

Replace the asterisk (*) with the relevant TPC ID parameter name. Supported parameters:

fbclid — Facebook

gclid — Google Ads

dclid — Google Display (CM360/DV360)

msclkid — Microsoft

ttclid — TikTok

Category: 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.

Category: 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)

Category: Order

__ADFORD__

Order name

__ADFORDID__

Order ID

Category: 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)

Category: Technical

__ADFEID_<source>_<atype>__

First-Party ID

Allows ad tags to pass Extended ID (EID) values to redirect URLs, tracking pixels, and clicks. It's replaced with the matching Extended ID value (encrypted, if available) from <source>.

Note

Matching for <source> isn't case-sensitive.

__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 generated 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.

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

__ADFRTBPUBID__

Exchange-specific publisher ID

__ADFRTBPID__

SSP partner ID

Category: 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

Category: 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

Samsung Ads Tracking Macros

If you run your ads on Samsung Ads platform, include the macro expubID=Samsungads to track your results and get accurate reports.

Adform provides a list of macros that you can append to Samsung ads:

Macro

Description

__RANDOM_NUMBER__

Random number

This is used to prevent caching and ensure unique tracking.

__IP__

User's IP address

__CAMPAIGN_ID__

Campaign ID

__FLIGHT_ID__

Flight ID

__CREATIVE_ID__

Creative banner ID

__DEVICE_ID__

Device ID

__TIMESTAMP__

Timestamp

This is used to prevent caching and to create a unique URL.

__APP_BUNDLE_ID__

App bundle ID

This is used to identify the app where the ad was served.

Important

Due to data restrictions, Samsung Ads are unable to accept Adform trackers and tags if you have Master Data services enabled.

Was this article helpful?

/
How we can make it better?

Thank you for your feedback!