DSP Macros

Macros are predefined expressions that are used to track and pass specific information.

Macros can be inserted in the banner's Target URL in case of hosted creative is used, or to the Ad Markup for the 3rd Party Ad Tag.

Target URL with inserted impression id macro for hosted creative:

Ad Markup with inserted impression id macro for 3rd Party Ad Tag:

All the macros available in the WL DSP can be divided into several groups.

Universal Tech Macros

Macro Name

Description

$!{imp_id}

Unique impression ID

$!{source}

SSP name (hash)

$!{random}

Passes a random value for cache busting

$!{bid}

CPM bid that won the impression

$!{timestamp}

Passes the Timestamp that received the impression

$!{imp_url}

Impression Notification beacon (client-side .gif pixel)

$!{imp_redirect_url}

Impression Notification+Redirect URL (client-side)

Should be used when an additional redirect is required when the Impression event is counted.

$!{click_redirect_url}

Click Redirect URL

$!{tid}

The token ID that uses for event tracking, unique for each event

$!{imp_nurl_url}

Impression Notification URL (S2S)

$!{imp_redirect_nurl_url}

Impression Notification+Redirect URL (S2S)

Should be used when an additional redirect is required when the Impression event is counted.

🚧

Please Note!

Only one Impression-based event should be used at the same time.

Campaign/Creative Related Macros

Macro Name

Description

$!{cid}

Campaign ID

$!{campaign}

Campaign name

$!{crid}

Creative ID

$!{creative}

Creative name

$!{width}

Creative width

$!{height}

Creative height

Publisher/Placement Related Macros

Macro Name

Description

$!{media_type}

App or site

$!{publisher_id}

Exchange specific publisher id

$!{app}

Name of the app where an ad is placed

$!{app_id}

ID of the app where an ad is placed

$!{site}

Name of the site where an ad is placed

$!{site_id}

ID of the site where an ad is placed

$!{site_url}

URL of the site where an ad is placed

$!{placement}

Name of either site or app where an ad is placed

$!{placement_id}

ID of either site or app where an ad is placed

$!{category}

IAB Category of site/app (IAB1-4;IAB7-9)

$!{subcategory}

IAB Subcategory of site/app (IAB1-4;IAB7-9)

$!{bundle}

Passes a numeric ID (for Apple) or bundle name (for Google) specific to the mobile app responsible for generating the click

Example values: “383763″ (Apple) or “com.google.mygoogleapp” (Google)

Device Related Macros

Macro Name

Description

$!{carrier}

Carrier used by a mobile device (Verizon, AT&T, T-Mobile)

$!{os}

Device OS (Android, iOS, BlackBerry OS, Windows Phone OS)

$!{os_version}

OS Version (Android 4.0.4, iOS 6.0.2)

$!{device}

Device type (iPad, DROID RAZR, Kindle Fire)

$!{device_id}

Hardware device ID (e.g., IMEI); hashed via SHA1

$!{device_model}

Device model (e.g., “iPhone”)

$!{device_make}

Device maker (e.g., “Apple”)

$!{device_hwv}

Hardware version of the device (e.g., “5S” for iPhone 5S)

$!{platform_id}

Platform device ID (e.g., Android ID); hashed via SHA1

Visitor Related Macros

Macro Name

Description

$!{gps_lat}

Latitude coordinates of the device

$!{gps_lon}

Longitude coordinates of the device

$!{country}

Visitor's country

$!{ip}

IP address of a user

$!{ua}

User-agent string

$!{ifa}

Mobile advertiser ID (IDFA if IOS or GAID if Android)

$!{idfa}

iOS User IDFA

$!{gaid}

Google Android ID

📘

Macro Encoding

If you click on the macro from the list you can copy it in four available variants:

  • Full - data will be passed the way it is
  • Encoded - data will be passed in an encoded form. This format is compatible with URLs and should be used if this macro is used in a URL.
  • Double Encoded - data will be passed in a double URL encoded form.
  • Escaped - data will be passed with all the special characters in this macro's value are escaped with \ symbol.

The most reliable way to transmit data is with the Encoded version of macros — this variant has the maximized compatibility.