Creative macros
6 min
a creative macro is a snippet of code that acts as a placeholder within the ad tag the macro is is dynamically replaced with a value when the ad is displayed for example, a macro might be used to insert a click tracking url to record when a user clicks on the ad a timestamp to record when the ad was shown using the click tracking url macro \[clickurl] as an example when an ad is about to be displayed to a user, the ad server would replace \[click url] with a unique url that tracks the click for that specific ad impression before you begin all macros are case sensitive the macros below have been categorized for use in specific purposes if the value for the macro is not available for replacement, it will be replaced with an empty string rich media macros rich media macros are used for rich media creatives, which refers to interactive or advanced ad formats that go beyond static banners or simple videos these might include expandable ads interactive videos ads that respond to user input (scroll, swipe, click) these macros are available for the entire markup \<font color="#f3f4f6">\</font> \<font color="#f3f4f6">macro is replaced by\</font> click url \[clickurl] a system generated click url when the markup is rendered encoded click url \[encodedclickurl] a url encoded, system generated click url when the markup is rendered redirect url \[redirecturl] encoded destination url entered when a creative is assigned to a campaign this is intended to be appended to the click url as a redirect query string parameter when appended, the system records the click when the click url is accessed, then redirect to the url in the redirect query string without performing any lookups if the redirect query string is not present in the click url, the destination url assigned to the creative is looked up in the database and then the user is redirected unique creative id \[uniquecreativeid] the value entered into the creative id field on the media provider markup page it corresponds to the unique creative id in the creative setup channel id \[channelid] the value entered into the placement id field on the creative page video macros a video macro is a placeholder used inside a vast (video ad serving template) tag the following macro is available for video markup only \<font color="#f3f4f6">macro\</font> \<font color="#f3f4f6">macro is replaced by\</font> video duration \[duration] the duration value from the video asset associated with the creative the output is in seconds for example, an output of 30 = 30 second video markup macros without logic a markup macro without logic is a simple placeholder that automatically pulls in data when an ad loads it doesn’t decide how or when to change content, it just inserts the specified value these macros are available for the entire markup \<font color="#f3f4f6">macro\</font> \<font color="#f3f4f6">macro is replaced by\</font> adtheorent id \[adtheorentid] the adtheorent device id from the bid request click id \[clickid] a system generated req ad id when the markup is generated advertiser id \[advertiserid] a system generated advertiser id advertiser name \[advertisername] the advertiser name that was selected for the response campaign id \[campaignid] the campaign id that was selected for the response campaign name \[campaignname] the campaign name which was selected for the response line item id \[lineitemid] a system generated line item id line item name \[lineitemname] the line item name that was selected for the response ad group id \[strategyid] the ad group id that was selected for the response ad group name \[strategyname] the ad group name from platform creative id \[creativeid] the creative id that was selected for the response creative name \[creativename] the creative name from platform creative height \[creativeheight] the creative height selected for the response creative width \[creativewidth] the creative width selected for the response iab category \[iabcat] the accepted iab categories in the bid request encoded iab delimiter \[enciabcat] the accepted iab categories in the bid request with encoded pipe delimiters latitude \[latitude] the latitude value (if exists) from the bid request longitude \[longitude] the longitude value (if exists) from the bid request zip code \[zipcode] the zip code value (if exists) from the bid request ad exchange \[adexchange] the name of the ad exchange this request came from publisher id \[publisherid] the publisher id coming in from the request media id \[mediaid] the website id of the property (per the exchange) dma \[dma] the geographic dma value from the bid request state \[state] the geographic state value from the bid request city \[city] the geographic city value from the bid request property id \[propertyid] the property id that gets augmented to the request after the lookup property name \[propertyname] the property name that gets augmented for app requests—it's replaced by the domain for site requests encoded page url \[encodedpageurl] the encoded media page url in the bid request do not track \[dnt] the dnt field in the bid request—0 if the field is not available in the bid request device carrier \[dcarrier] the user's device carrier in the bid request device model \[dmodel] the user's device model in the bid request device os \[dos] the user's device operating system in the bid request device type \[devicetype] the device type (integer value) in the bid request preference \[preference] the bid request's newsiteapp mediatype name (site, app, all, none, invalid) user agent \[useragent] the bid request's user agent—commas are replaced with pipes raw user agent \[rawuseragent] the bid request's user agent—as is from the bid request, no replacement unix time \[unixtime] the current timestamp in unix format this is the time at which the macro itself is replaced skadnetwork campaign id \[skadcampaignid] the final two digits of the ad group id from platform this is the same value used for campaign id in the skadnetwork bid responses app bundle id \[appbundle] the app bundle id (mediabundle) in the bid request 3rd party ad id (placement id) \[3padid] the 3p ad id that's associated with the creative selected for the response temperature \[temperature] the temperature augmented from the weather service based on the zip code cookie id \[cookieid] the cookie from the bid request if the cookie is empty, this macro is replaced by an empty string user cookie \[usercookie] if a cookie is available, use that if a cookie is not available, replace it with \[adtheorentid] pollen \[pollen] the pollen value augmented from the weather service based on the zip code deal id \[dealid] the deal id that will be sent in the bid response markup macros with logic a markup macro with logic adds conditions to a placeholder—letting you tell the ad when and how to show certain content the following macros are available for the entire markup \<font color="#f3f4f6">macro\</font> \<font color="#f3f4f6">macro is replaced by\</font> idfa \[idfa] if the adtheorentidcode = 'idfa', this macro is replaced by \[adtheorentid] if adtheorentidcode != 'idfa', this macro will be replaced with an empty string upper idfa \[upperidfa] if the adtheorentidcode = 'idfa', then adtheorentid is in uppercase if adtheorentidcode != 'idfa', this macro will be replaced with an empty string ip address \[ipaddress] the ip address value from the id request for all the ad exchanges except adx operating system \[os] deviceos if the values are either 'ios' or 'android' for the rest, it gets replaced with empty string inventory id \[inventoryid] if mediabundle is not empty, the macro populates with mediabundle if pagedomain is not empty, the macro populates with pagedomain if mediadomain is not empty, the macro populates with mediadomain not populated in all other cases ad platform \[kochava ad platform] this is leveraged by kochava links for probabilistic attribution in app (for in app inventory) m web (for mobile web inventory) web (for desktop inventory) not populated in all other cases apple ios app tracking transparency (att) user authorization \[iosatt authorization] 0 att tracking not authorized = 0, 1, or 2 in bid request object bidrequest device ext 1 att tracking authorized field = 3 in bid request object bidrequest device ext); not populated in all other cases apple ios app tracking transparency compatibility \[iosatts] 0 in the \[iosatts] field = 0 in the bid request object bidrequest device ext 1 in the \[iosatts] field = 1 in bid request object bidrequest device ext 2 in the \[iosatts] field = 2 in bid request object bidrequest device ext 3 in the \[iosatts] field = 3 in bid request object bidrequest device ext not populated in all other cases product catalog \[catalog] the value from the product catalog creative field on the creative this value represents the product catalog key to a product catalog in the product database this macro is used in product creatives to alert which catalog is being served product catalog products \[products] the matched product catalog comma delimited product key values when passing retargeting on a product catalog pixel, the matched retargeting identifier is used to find the last viewed products only the products found that match the above \[catalog] will be returned

