A macro is a change to a string of text that makes up third-party ad tags that is made in order to allow publisher and advertiser to accurately perform certain functions, such as counting impressions and clicks. Inserting macros into third-party tags involves removing a certain string of text from the “raw” tags and replacing it with a standardized code. For example, a cachebuster macro can be inserted by replacing a line of code with: %%CACHEBUSTER%%.

The most commonly-implemented macros include:

  • Cachebuster Macros. This macro is inserted to force the platform to make a new call to the ad server each time an impression is served (instead of serving up a cached image). This is perhaps the most important macro; it helps to avoid counting discrepancies.
  • Click Macros. This macro lets publishers track the number of times a third-party ad is clicked. This is valuable information if you are monitoring campaign performance; it will allow you to spot under-performing units and be prepared to optimize.

These are the most important macros to insert into ad tags. There are a number of other macros available if needed. The adjacent table contains a link to a more detailed explanation of all macros from DFP.

Implementing Macros

Many ad servers will automatically insert macros into third-party tags from known platforms. For example, DFP will show the following message after a publisher uploads third-party tags:

DFP Screenshot When Tags are Recognized

If the ad server platform does not recognize the tags as being generated by a known platform, publishers will need to insert the macros themselves. Below is an example of the message that appears in DFP:

When Third Party Tags are Not Accepted

It is generally possible to upload and save ad creatives without inserting macros. However, this is not recommended; it will more often than not cause headaches down the road (especially if there are discrepancies in billing).

Many third-party ad tag providers have online manuals that help advertisers insert macros “manually” if needed.