Macros

Include macros in any code that's handled by an ad server during delivery. You can update the macro reference so you don't have to update the creative code. #macros

Macros are special strings in creative code. Ad Manager later replaces this string with another value or code based on a creative's settings. Macros are useful because you don't have to directly update creative code if you need to make changes—you can update the macro reference.

For each macro, we've provided suggestions on how you might use it, but macros can be put to whatever uses are most valuable for you. Macros can be included in any code that's processed by the ad server during delivery: third-party or custom creative code, Studio code, click-through URLs, or ad tags.

Important notes about macros

  • Case-sensitivity
    Macros are case-sensitive. Use %%CACHEBUSTER%%, not %%Cachebuster%%.
  • Unescaped and escaped expansion
    Unescaped and escaped macro versions expand differently. Learn how to use escaped and unescaped macros.
  • Macro insertion
    Ad Manager inserts macros automatically for third-party creatives or VAST tag URLs if Ad Manager recognizes the third party. For custom creatives and creative templates, you need to add the macros manually. If you are unsure where to place a macro, contact your creative vendor.
    When trafficking with a creative template, a Click-through URL input will only be present when a click macro is used in the template.
  • Reserved characters and URL encoding (percent encoding)
    Ad Manager reserves certain lowercase letters preceded by a percentage:

    %a
    %c
    %h
    %i
    %n
    %p
    %k

    These strings should not be used in URL encoding as they can interfere with macro expansion.

  • Macros aren't supported for Programmatic Direct
    See the available features for Programmatic Direct.

Expand all  Collapse all

Rendering macros

Rendering macros are commonly used to render creatives, ensuring they look right and work correctly.

Tracking macros

These macros are most commonly used for tracking and reporting purposes.

Ad request macros for GDPR

These macros are most commonly used with ad requests that are subject to GDPR.

Video macros

These macros are commonly used in video creatives to include details about the context or content.

 
You can use the tag parameter macro in conjunction with some video parameters to expand to the value of those parameters.

Video content macros

These macros are used for ads that target video content sources.

Only available in Google Ad Manager 360.

Was this helpful?

How can we improve it?
true
Release notes

Read about the latest Ad Manager features and Help Center updates.

See what's new

1276209738734535298
true
Search Help Center
true
true
true
true
true
148
Search
Clear search
Close search
Main menu
false
false
false
false