A macro is a short command or shorthand for an instruction and usually follows the format ${MACRO_NAME}
. The Advertising Cloud DSP ad server executes macros when the ad is served or clicked.
Macros are most commonly used during trafficking of third-party and custom creative code or metadata (such as third-party pixels).
Use general tracking macros across all ad and tag types to pass back specific data, as required.
Macro | Description |
---|---|
$ | User identifier for all device types. |
$ | Cachebuster: a random number between 1 and 1000000 |
$ | The placement ID |
$ | The URL passed in the bid request; URL-encoded |
$ | The page subdomain parsed from the URL in the bid request; URL-encoded |
To accurately track clicks for ads using third-party display tags, DSP requires a display click macro. Only one version of the macro is required; the relevant macro depends on the type of tag.
Macro | Description |
---|---|
$ | Redirect URL that enables ad servers to track and count ad clicks in the platform |
$ | Redirect URL that enables ad servers that require URL encoding to track and count ad clicks in the platform |
DSP automatically inserts display click macros in a display tag when you:
If a click macro is missing when you build a display ad, DSP displays a warning message, which prompts you to manually insert the appropriate display click macro in the correct area of the tag.