Macros
  • 27 Jun 2023
  • 3 Minutes to read
  • Dark
    Light

Macros

  • Dark
    Light

Article summary

Overview

Samsung DSP provides a number of macros, which serve as placeholders that are automatically substituted by the appropriate values at delivery time. Macros can be used when configuring 3rd party tags, 3rd party trackers or Universal Segment. They are usually input as part of the URL of a tracker or within the value of a Javascript variable.

3rd party tags and trackers

The following macros are available in Samsung DSP when configuring an Ad Server Tag creative, piggybacking HTML code to an uploaded Image creative, or from impressions and click tracker URLs, as well as video events trackers:

Note that all Samsung DSP macros start and end with 2 underscores (_).

Macro

 Type

 Description

__ADVERTISER_ID__

integer

The advertiser ID for this impression (e.g. 324).

__ADVERTISER_NAME_ENCODED__

string

The URL component encoded name of the advertiser for this impression (e.g., "Acme%20Corp").

__APP_BUNDLE_ID__

When delivering in countries under the General Data Protection Regulation (GDPR), this macro can only be added to trackers from Samsung certified vendors.

string

The application bundle ID identifying the application from which the ad request was initiated, for in-app advertisements (e.g., "com.ae.history"). This value is configured or passed to the ad exchange by the application publisher or representative for in-app advertisement traffic originating from various app platforms such as iOS, Android, Tizen TV, etc. App bundle ID values may be re-used between platforms so it is advisable to consider this value in conjunction with user-agent or detected device and/or platform type (e.g., "com.ae.history" on Tizen TV may be different than "com.ae.history" on Android).

__APP_BUNDLE_ID_ENCODED__

When delivering in countries under the General Data Protection Regulation (GDPR), this macro can only be added to trackers from Samsung certified vendors.

string

The URL component encoded application bundle ID.

__CAMPAIGN_ID__

integer

The campaign ID for this impression (e.g., 123).

__CAMPAIGN_NAME_ENCODED__

string

The URL component encoded name of the campaign for this impression (e.g., "Summer%20Sale%20Campaign").

__CLICK_TRACKER_URL_ENCODED__

string

Same as __CLICK_TRACKER_URL__ but URL component encoded (e.g. "http%3a%2f%2frtb.adgrx.com%3a8084%2fclicks%2fINFO%2f").

__CREATIVE_ID__

integer

The creative ID for this impression (e.g., 234).

__CREATIVE_NAME_ENCODED__

string

The URL component encoded name of the creative for this impression (e.g., "Blue%20Version1").

__DECLARED_URL__

string

The site URL, as declared by the exchange seller (e.g. "http://samsung.com/").

__DECLARED_URL_ENCODED__

string

The same as __DECLARED_URL__ but URL component encoded (e.g. "http%3A%2F%2Fsamsung.com").

__DEVICE_UID_TYPE__

string

The device unique ID type. Possible values are: ag_cookie, apple_ifa or google_ifa

__DEVICE_UID__

When delivering in countries under the General Data Protection Regulation (GDPR), this macro can only be added to trackers from Samsung certified vendors.

string

The device unique ID value to go along with the device unique ID type.

__FORMAT__

string

The format/size for this impression (e.g. "300x250").

__FLIGHT_ID__

integer

The flight ID for this impression (e.g. 324).

__FLIGHT_NAME_ENCODED__

string

The URL component encoded name of the flight for this impression (e.g., "CPM%20Optimized%20Flight").

__IP__

When delivering in countries under the General Data Protection Regulation (GDPR), this macro can only be added to trackers from Samsung certified vendors.

string

The IP address of the browser/device for this impression (e.g., 192.168.1.1).

__PROTOCOL__

string

The protocol used for delivering this impression (http or https).

__RANDOM_NUMBER__

string

A random number string typically used to construct non-cacheable URLs.

__SPOT_ID__

string

The spot ID for the impression (e.g. "5664451242760709529"), unique to a single spot within a bid request (note: a single bid request may contain multiple spots, so an impression is uniquely identified by the combination of __BID_REQUEST_ID__ and __SPOT_ID__).

__TIMESTAMP__

integer

The number of seconds elapsed since the epoch date, January 1, 1970 (UTC) at the time of the impression call (e.g., 1490936822).

__TXN_ID__

string

The unique ID for this impression (e.g., "c0728d4e-6691-11e3-9c63-fb540000002f:5664451242760709529"). This is typically used for server-side conversion tracking. It can be passed via a click tracker to the destination page where the destination site later associates it with a transaction and reports it back to Samsung DSP by calling a conversion tag. Note that this is usually equal to __BID_REQUEST_ID__:__SPOT_ID__.

__TXN_ID_INT__

integer

Numerical version of the __TXN_ID__, useful when you need a unique integer ID for a Bid Request and Impression combo.

NOTE: This macro cannot be used for conversion attribution.

Universal segment

The following macros are available in Samsung DSP when configuring a piggyback HTML code inside a Universal Segment:

Macro


 Type


 Description


__AG_URL__

string

The URL passed to the universal tag, either manually (in the __AG variable) or automatically.

__AG_REV__

number

The revenue number passed to the universal tag (in the __AG variable).

__AGDATA[name]__

string or number

Any variable set in the __AGDATA JavaScript variable. Replace name with the name of the variable.

See also


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.