You are here: Publishers > Macros > Supported macros

Supported macros (Publishers)

Last updated November 3, 2016

OpenX automatically replaces each macroFor OpenX, a command enclosed in curly braces {} that dynamically inserts attributes into your HTML or third-party ad creatives and click-through URLs when OpenX serves an ad. Other macros, like from your video player, may have alternate formatting. with the value specified in the following list.

Ad macros

  • ad.click_target

    Is replaced with: The browser window target when a user clicks the selected ad that OpenX serves (_blank, _parent, _self, _top, or _custom).

    For example: _blank

  • ad.id

    Is replaced with: The OpenX ID for the selected ad that OpenX serves.

    For example: 27918

  • ad.size

    Is replaced with: The width-by-height dimensions (in pixels) for the image, flash, HTML, or third-party ads that OpenX selects and serves.

    For example: SIZE.WEB.300x250 or SIZE.WEB.CUSTOM.800x600

  • ad.type

    Is replaced with: An integer which represents the ad type for the selected ad that OpenX serves. This can be one of the following:

    For example: 2

  • Ad unit macros

  • adunit.id

    Is replaced with: The OpenX ID for the ad unitThe smallest inventory component that represents the space on a site where ads display. making the ad request.

    For example: 16679

  • adunit.medium

    Is replaced with: The delivery mediumThe manner in which an end-user is exposed to ad inventory, such as web or mobile. for the ad unit where the selected ad displays, such as web or email.

    For example: DMID.WEB

  • adunit.topic_id

    Is replaced with: An integer, which represents the content topicDescribes the main subject of the online content surrounding the ad space, such as sports or automotive. ID associated with the ad unit making the ad requestCommunication from a web browser or app to an ad server to display an ad.. For more information about possible content topic IDs, contact your OpenX account manager.

    For example: 9999

  • Advertiser ID macro

  • advertiser.id

    Is replaced with: The OpenX ID for the advertiserIn OpenX, an account type that represents a business that runs advertising campaigns to display ads on websites. that the selected ad belongs to.

    For example: 9832

  • Click URL macros

  • clickurl

    Is replaced with: The unencoded and time-sensitive URL for the selected ad that OpenX serves, which enables click-tracking.

    For example: http://ads.example.com/w/1.0/rc?ts=555YADAYADA555&r=

  • clickurl_dbl_enc or clickurl_dbl_esc

    Are replaced with: The double-encoded and time-sensitive URL for the selected ad that OpenX serves, which enables click-tracking.

  • clickurl_enc or clickurl_esc

    Are replaced with: The encoded and time-sensitive URL for the selected ad that OpenX serves, which enables click-tracking.

    For example: http%3A%2F%2Fads.example.com%2Fw%2F1.0%2Frc%3Fts%3D555YADAYADA555%26r%3D

  • Key-value pair macro

  • c.xxx

    Is replaced with: The value for any custom key-value pair enrichment variable. For example, if you have a custom variable for users' names or hobbies (e.g., c.name= or c.hobby=) and you then inserted the {c.name} or {c.hobby} macros, OpenX would replace the macros with the values of the custom variables.

    For example: c.name or c.hobby

  • Demographic macros

  • demo.age

    Is replaced with: The current user's age (in years) if OpenX receives this information from the publisherAn account type that represents a business with ad space to sell.'s siteAn OpenX component that represents top-level domains or sub-domains and is used to organize ad units. Sites enable you to target and report on inventory performance..

    For example: 38

  • demo.ethnicity

    Is replaced with: The current user's ethnic association if OpenX receives this information from the publisher's site. This can be one of the following:

    • 0 for African American

    • 1 for Asian

    • 2 for Hispanic

    • 3 for White

    • 4 for Other

    For example: 2

  • demo.gender

    Is replaced with: The current user's gender if OpenX receives this information from the publisher's site. This can be one of the following:

    • F for Female

    • M for Male

    • O for Other

    For example: F

  • demo.income

    Is replaced with: The current user's annual income in US dollars (excluding periods (.) or commas (,)), if OpenX receives this information from the publisher's site.

    For example: 40000

  • demo.marital

    Is replaced with: The current user's marital status if OpenX receives this information from the publisher's site. This can be one of the following:

    • M for Married

    • S for Single

    • D for Divorced

    For example: M

  • External ID macro

  • external.id

    Is replaced with: An external user ID passed via the xid parameter for use in applicable reports.

    For example: 234hskhjfdkhjs

  • Geo macros

  • geo.city

    Is replaced with: The city location for the end-user viewing the ad unit, which is making the ad request.

    For example: los angeles

  • geo.continent

    Is replaced with: The continent location for the end-user viewing the ad unit, which is making the ad request.

    For example: north america

  • geo.country

    Is replaced with: The country location for the end-user viewing the ad unit, which is making the ad request.

    For example: us

  • geo.dma

    Is replaced with: The DMA (Designated Market Area) location for the end-user viewing the ad unit, which is making the ad request.

    For example: 803

  • geo.latitude

    Is replaced with: The latitude location for the end-user viewing the ad unit, which is making the ad request.

    For example: 33.684

  • geo.longitude

    Is replaced with: The longitude location for the end-user viewing the ad unit, which is making the ad request.

    For example: -117.793

  • geo.msa

    Is replaced with: The MSA (Metropolitan Statistical Area) location for the end-user viewing the ad unit, which is making the ad request.

    For example: 31100

  • geo.postal_code

    Is replaced with: The postal code location for the end-user viewing the ad unit, which is making the ad request.

    For example: 92602

  • geo.region

    Is replaced with: The region location for the end-user viewing the ad unit, which is making the ad request.

    For example: southwest

  • geo.state

    Is replaced with: The state location for the end-user viewing the ad unit, which is making the ad request.

    For example: california

  • Line ID macro

  • line.id

    Is replaced with: The OpenX ID for the selected line itemThe primary unit of execution for an order, which represents a specific inventory purchase and the required conditions for ad delivery..

    For example: 3478

  • Market ID macro

  • market.id

    Is replaced with: The OpenX Market ID, which indicates that the user opted in to OpenX Ad Exchange.

    For example: 83941917-ada8-437f-9197-9f816caad187

  • Order ID macro

  • order.id

    Is replaced with: The OpenX ID for the selected order.

    For example: 4329

  • Page ID macro

  • page.id

    Is replaced with: The OpenX ID for the ad unit groupA collection of ad units where related ads display together at the same time. making the ad request (in the case of companion ads).

    For example: 224

  • Publisher ID macro

  • publisher.id

    Is replaced with: The OpenX ID for the publisher that the ad unit belongs to.

    For example: 441

  • Random macro

  • random

    Is replaced with: A random, ten-character, alphanumeric string, which is useful for cachebusting.

    For example: QWzLUh1FEK

    Note: If you place multiple {random} macros in a creativeThe media asset associated with an ad, such as an image or video file., each returns a different random value. For example, if your HTML creative contains:

    1. {random}

    2. {random}

    Then OpenX replaces each {random} macro with a different random value; for example:

    1. QWzLUh1FEK

    2. qbKM22B57Q

  • Section ID macro

  • section.id

    Is replaced with: The OpenX ID for the section of the site where the ad unit resides.

    For example: 5024

  • Site ID macro

  • site.id

    Is replaced with: The OpenX ID for the ad unit's container site.

    For example: 401

  • Storage ID macro

  • storage.id

    Is replaced with: The unique userA site's total number of users or visitors over a certain length of time. Accuracy depends on each user logging in with a unique cookie to access the site, such as a different browser. ID of the Ad ServerA complete digital advertising platform where publishers sell, manage, and deliver their advertising inventory across all digital formats..

    For example: 400b89aa-7f91-0de4-3b72-9c9d3817e970

  • Technographic macros

  • techno.carrier

    Is replaced with: The carrier for the user's mobile device, if OpenX receives this information from the publisher's app. This is defined by the Mobile Country Code (MCC) and Mobile Network Code (MNC); that is, MCC-MNC.

    For example: 310-410

  • techno.device.category

    Is replaced with: The device category of an ad request. This can be one of the following:

    • desktop

    • phone (refers to a smart phone)

    • tablet

    • text (refers to a feature phone or an unknown device)

    For example: text

  • techno.device.manufacturer

    Is replaced with: The maker of the user's mobile device.

    For example: Apple

  • techno.device.type

    Is replaced with: The model of the user's mobile device.

    For example: iPad

  • techno.domain

    Is replaced with: The top-level domain used for techno.page_url.

    For example: currentwebpage.com

  • techno.network

    Is replaced with: The end-user's network connection type.

    For example: wifi

  • techno.os.type

    Is replaced with: The name of the operating system for the user's mobile device.

    For example: iOS

  • techno.os.version

    Is replaced with: The version of the operating system for the user's mobile device.

    For example: 6

  • techno.page_url

    Is replaced with: The URL of the current webpage.

    For example: http://currentwebpage.com

  • techno.page_url_enc

    Is replaced with: The encoded URL of the current webpage.

    For example: http%3A%2F%2Fcurrentwebpage.com

  • techno.protocol

    Is replaced with: The internet protocol that the user's web browser uses to communicate with OpenX.

    For example: http or https

  • techno.referrer_url or techno.referrer_url

    Is replaced with: The URL of the referring webpage, which directed the end-user to the current webpage.

    For example: http://webpage_before_currentwebpage.com

  • techno.referrer_url_enc or techno.referer_url_enc

    Is replaced with: The encoded URL of the referring webpage, which directed the end-user to the current webpage.

    For example: http%3A%2F%2Fwebpage_before_currentwebpage.com

  • techno.user_agent

    Is replaced with: The user agent string for the user viewing the ad unit, which is making the ad request, as passed from the end-user's browser.

    For example: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10

  • Timestamp macro

  • timestamp

    Is replaced with: The current timestamp for the ad request, in UNIX format, which may also be used for cachebusting (although using {random} is preferred).

    For example: 1304435103

  • Unique macro

  • unique

    Is replaced with: A random, ten-character, alphanumeric string.

    For example: qbKM22B57Q

    Note: If you place multiple {unique} macros in a creative, each returns the same unique value. So, for example, if your creative HTML contains:

    1. {unique}

    2. {unique}

    Then OpenX replaces each {unique} macro with the same value; for example:

    1. qbKM22B57Q

    2. qbKM22B57Q

  • User macros

  • user.dev.androidadvertiserid

    Is replaced with: The advertising ID, which is a user-specific, unique, resettable ID for advertising, provided by Google Play services.

    For example: 81ce9460-0834-42db-9d1d-4167d826db2a

  • user.dev.androidadvertiserid.enabled

    Is replaced with: A true or false flag indicating whether the ID is to be used for user targeting. For more details, refer to Google’s privacy policy.

    For example: true

  • user.deviceid

    Is replaced with: The unique ID for the current user's mobile device, if OpenX receives this information from the publisher's app.

    For example: 2b6f0cc904d137be2e1730235f5664094b831186

  • user.dev.idforad

    Is replaced with: The identifier for advertising for Apple's iOS6 operating system on the end-user's mobile device, if OpenX receives this information from the publisher's app.

    For example: 43043FE3-6BA9-4515-8209-6E0AC6AE1ADF

  • user.dev.androidid.md5

    Is replaced with: The MD5 hash of the Android ID for the end user's mobile device, if OpenX receives this information from the publisher's app.

    For example: aecf017051bfa70b77249910d1ff516f

  • user.dev.androidid.sha1

    Is replaced with: The SHA-1 hash of the Android ID for the end user's mobile device, if OpenX receives this information from the publisher's app.

    For example: b17dbc82319689a0accdd3af2b806d480de41cdc

  • user.dev.idforad.enabled

    Is replaced with: The boolean value indicating whether the user's iOS device has ad tracking on or off, if OpenX receives this information from the publisher's app. This can be either:

    • True - Ad tracking is enabled

    • False - Tracking is disabled

    For example: true

  • user.dev.macaddress.md5

    Is replaced with: The MD5 hash of the MAC address for the end-user's mobile device, if OpenX receives this information from the publisher's app.

    For example: f16f225b0e76f089e94d1fc8cb0a9fb0

  • user.dev.macaddress.sha1

    Is replaced with: The SHA-1 hash of the MAC address for the end-user's mobile device, if OpenX receives this information from the publisher's app.

    For example: 3a9e50f8ae66f63361423ff71506d41247810863

  • user.dev.odin1

    Is replaced with: The Open Device Identification Number (ODIN-1) for the end-user's mobile device, if OpenX receives this information from the publisher's app.

    For example: e1b33694687ded5475f72f996cf025be3dd160fe

  • user.dev.openudid

    Is replaced with: The OpenUDID for the end-user's mobile device, if OpenX receives this information from the publisher's app.

    For example: 34a265c3b73e4e for Android, or 7a5fab3d942494f7e31be4f4eec0e8156f53c6bf for iOS.

  • user.dev.secureudid

    Is replaced with: The SecureUDID for the end-user's mobile device, if OpenX receives this information from the publisher's app.

    For example: 50647BB4-DA42-49B4-9A8F-541203150654

  • user.ip

    Is replaced with: The IP address for the end-user's carrier gateway.

    For example: 238.122.7.1

Note: If you use a macro for which OpenX is unable to find a replacement value, then OpenX ignores the macro and leaves it in place in the ad creative or click URL. For example, if you insert a {c.name} macro in an HTML ad creative, and OpenX is unable to derive a value for {c.name}, then OpenX ignores the macro and leaves it as-is in the ad creative.

This topic applies to Ad Server. This topic applies to Ad Exchange. This topic applies to SSP. Most SSP activities are completed by OpenX.

Feedback form