A macro is a short command or shorthand for an instruction to the DoubleClick ad server. Macros usually follow the format of %%MACRO_NAME%% (examples: %%CACHEBUSTER%% %%CLICK_URL_UNESC%%). The DoubleClick ad server executes macros when the ad is served or clicked. Macros are most commonly used when a publisher traffics third-party creative code, but macros can also be used in custom creatives.
Every third party has a different ad tag format and the macros are inserted in different spots in the tag depending on the third party. Every time you work with a new third party, you should get documentation from them on where the macros go in their ad tags when trafficked in DoubleClick for Publishers (DFP).
The two most common macros are click tracking macros and cache-busting macros. The click tracking macro ensures that DFP is counting clicks when a user clicks on the creative. The cache-busting macro ensures that a fresh call is made to the ad server every time the code is executed, so you’re accurately counting impressions. It’s very important to make sure that you always insert the macros properly; the third party should provide you with guidance and support.
Click-tracking macro
A click-tracking macro ensures that DFP is counting clicks when a user clicks on a creative that is hosted by an ad server other than DFP. There are two types of click-tracking macros:
- Unescaped click macro: %%CLICK_URL_UNESC%%
- Double-escaped click macro: %%CLICK_URL_ESC_ESC%%
%c will still work for creatives trafficked in DART, but we strongly recommend using the new syntax for all new creatives trafficked in the DFP upgrade.
As a best practice, we recommend using an unescaped click macro when the creative hosted by another server is a standard image file (GIF/JPG). You should use the double-escaped click macro for Flash (SWF) creatives and for certain third parties. You can preview the ad and right-click it to determine its file type. If you see a “Save Image As...” or “Save Picture As...” option appear in the right-click menu, the creative is a standard image. If you see an “About Adobe Flash Player...” option, the creative is a Flash creative.
A small number of third parties use double escaping (%%CLICK_URL_ESC_ESC%%). For certified third parties, we’ll auto-insert this double-escaped click macro; however, if you’re unsure whether you need a single- or double-escaped macro, you should reach out to the third party for confirmation.
Warning: If you don't put a click-tracking macro in the correct place in your third-party code, you will most likely not track clicks on the creative. Talk to your third-party creative provider to learn where to put the click macro.
Cache-busting macro
The cache-busting macro ensures that a fresh call is made to the ad server every time the code is executed, so you’re accurately counting impressions. Here is what the cache-busting macro looks like:
- Cache-buster macro: %%CACHEBUSTER%%
If you don't add the cache-busting macro to the creative code, you’re more likely to see impression counting discrepancies between DoubleClick for Publishers and the third party ad server.
Source: Google Support