Search Images Maps Play YouTube News Gmail Drive More »
Sign in

Custom rich content and third-party tags

Traffic third-party creatives

Some of your advertisers may be working with a third-party ad server such as Atlas or Mediaplex to serve their creatives. If an advertiser sends you a piece of creative code (also known as an ad tag) that calls another ad server, you will need to traffic that creative as a Third-party creative. (See a list of certified third-party vendors.)

The key to successfully serving third-party creatives and minimizing discrepancies is to make sure that you are properly inserting macros in the third-party code.

In most cases, you should traffic third-party ad tags as Third-party creatives, not Custom creatives, to ensure that macros from our list of certified vendors are automatically inserted. (Custom creatives do not automatically insert macros, leaving more room for error.)

The exception is when you need to customize the third-party code by, for example, adding a tracking pixel or other code for troubleshooting purposes. In these cases, you can create a custom template and add the third-party code with your changes to the template. See Creative templates to learn how.

To traffic a third-party creative:

  1. In your DoubleClick for Publishers (DFP) account, click the Orders tab.

  2. Click the order where you'd like to add the creative. (You can't add creatives to canceled or completed orders.)

  3. Click the line item where you'd like to add the creative. You can also create a new line item, if needed.

  4. Click Add creatives and select new creative under the ad unit size you want.

    All creatives and ad unit dimensions associated with your line item will be listed. You can upload creatives to any unit size in this list.

  5. Select Third-party.

  6. Paste the tags from a third-party ad server into the Code snippet field.

    • If DFP recognizes your creative, click Insert macros and DFP will automatically insert the appropriate macros into your code snippet.

    • If DFP does not recognize your creative, place your cursor within the code snippet where a macro should be placed, then click the corresponding button to insert the macro.

      If there are no instructions in the ad tag for where the macros should go or you’re not completely sure, have your client talk to the third party. Ask your client to get instructions for inserting the macros so DFP can serve the creative properly and track clicks and impressions. Since the third party knows their code better than anyone else, it’s always best to go to the third party, as DoubleClick doesn’t keep track of where macros should be inserted in non-certified third-party vendors.
  7. Enter the name for your creative.

  8. Select the ad unit size where the creative should deliver.

  9. Click Save and preview the creative to ensure it’s serving properly. If you notice a problem with how the creative looks, talk to the advertiser.


What is a macro and why is it so important when trafficking third party creatives?

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.

My third-party told me where to insert the macros but I'm still not sure where they should go

Let's look at an example tag. You'll see that the tag below includes two pieces of code, %%Cache_buster%% and %%Pub_click%%. If your advertiser sent you this code, replace %%Cache_buster%% with %%CACHEBUSTER%% and replace %%Pub_click%% with either %%CLICK_URL_UNESC%% or %%CLICK_URL_ESC%%. (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 escaped click macro for Flash (SWF) creatives.)

In the following example, we've bolded where the cache buster and click macros would go:

<iframe src="//my.adserver.com/MON/iview/mlbdvmon0770000134mon/direct/01 %%Cache_buster%%?click=%%Pub_click%%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" allowtransparency="true" width="300" height="250"> <script language="JavaScript" type="text/javascript"> document.write('<a href="%%Pub_click%%http://clk.my.adserver.com/MON/go/mlbdvmon0770000134mon/direct/01/" target="_blank"><img src="//my.adserver.com/MON/view/mlbdvmon0770000134mon/direct/01/ %%Cache_buster%%"/></a>'>; </script> <noscript><a href="%%Pub_click%%http://clk.my.adserver.com/MON/go/mlbdvmon0770000134mon/direct/01/" target="_blank"><img border="0" src="//my.adserver.com/MON/view/mlbdvmon0770000134mon/direct/01/ %%Cache_buster%%" /></a></noscript></iframe>

Again, this is only an example and every third party has a different ad tag format. In general, you should look for language like "cachebuster" or "[timestamp]" for the cachebusting macro and "clickurl," "click redirect" or "pubclick" for the click tracking macro. Often, the third party will capitalize the code that you're replacing with the macros, such as "[INSERT AD SERVER CLICK REDIRECT HERE]".

Still not sure if you're adding macros properly? Ask the third party for assistance. Unfortunately, DoubleClick support doesn't know the most up-to-date code the third party uses, so the third party is your best bet for help.


Troubleshoot third-party issues

For more information, see How to investigate discrepancies

You can also use the troubleshooter for third-party creatives to diagnose your issue.