Introducing the Google Publisher Tag

What is the Google Publisher Tag?

We're offering a new ad tag called the Google Publisher Tag (GPT) that provides you with a number of new benefits and improvements over existing Google Ad Manager (GAM) tags.

Will my Google Ad Manager tags still work?

Yes. You don’t have to re-tag your site. However, re-tagging is highly recommended in order to leverage the additional benefits provided with the Google Publisher Tag, such as the Google Publisher Console or single request mode. Your existing GAM tags will continue to work without any changes.

Can I use different tagging styles on the same network? On the same page?

You should ensure that a given page only contains GPT tags since the DFP ad server may not be able to correlate multiple request types, which will prevent ads from serving. However, it's OK to have one page that uses GPT and one that uses GAM tags as you upgrade from Google Ad Manager tags to the Google Publisher Tag.

When should I disable Google Ad Manager tag generation?

Only disable GAM tag generation after you've re-tagged your site with Google Publisher Tags. Once you do disable GAM tag generation, you'll be able to take advantage of the following functionality:

  • Companion ads for video VAST line items
  • Multi-size ad units

To disable GAM tag generation, go to the "Admin" tab and click "Features" (you'll need administrator rights). You might also be prompted to disable GAM tag generation when performing certain actions, such as creating a video VAST line item.

What are the benefits of using the new Google Publisher Tags?

There are multiple benefits of using these new tags:

  • Faster page loads: An asynchronous JavaScript fetch means that instead of waiting for the JavaScript to be returned from the DoubleClick servers, the page continues rendering and loads the ads into iframes when the creatives are returned from the server.

  • Google Publisher Console: The tag comes with a built-in debugging and support tool called the Google Publisher Console, which is enabled on all pages containing the Google Publisher Tag.

    To activate the Publisher Console, load your webpage containing Google Publisher Tags into a browser and append ? google_console= 1 to the URL and use the keyboard shortcut Ctrl+F10 to toggle the console. Alternatively, you can append ? google_force_console= 1 to your page's URL. This causes the console to be automatically displayed when the page is loaded, rather than requiring the keyboard shortcut.

    The console provides checks for common tagging errors, visual highlights of all ad units and creatives on the page to help with debugging, and an alternative point of entry into the DFP front-end.

  • Single request mode: Single request mode means that instead of sending individual ad requests to DoubleClick servers, the browser is able to send one request notifying the server of all ad units on the page. This enables advanced roadblocking and improves page load time.

  • Automated setup for interstitials: DFP lets you specify that your tags are for an out-of-page unit and automatically adds the additional code. There's no need to add code manually.

What are the differences between Google Ad Manager (GAM) tags and the new Google Publisher tags?

The Google Publishers Tags provide a number of benefits over the GAM tags. Here are some of the differences between the two types of tags:

Features Google Ad Manager tags Google Publisher Tags
Number of ad requests per page Equal to number of ad slots per page (up to 16) One ad request per page with single request mode
Access to the Google Publisher Console No Yes
Passbacks No Yes
Multiple instances of the same ad unit on a page No Yes
SSL support No Yes
Slot-level custom targeting No (only for AdSense parameters) Yes
Asynchronously refreshing ad slots on a page No Yes
Non-JavaScript rendering (for email ads) No Yes
Can you show me an example of a translated tag with targeting?

With the Google Ad Manager tag:

<!-- header -->
<script type='text/javascript' src='http://partner.googleadservices.com/gampad/google_service.js'>
</script>
<script type='text/javascript'>
  GS_googleAddAdSenseService("ca-pub-4979655154758341");
  GS_googleEnableAllServices();
</script>
<script type=’text/javascript">
  GA_googleAddAttr("Gender", "Male");
  GA_googleAddAttr("Interest", "Cars");
</script>
<script type='text/javascript'>
  GA_googleAddSlot("ca-pub-4979655154758341", "tagging_test");
</script>
<script type='text/javascript'>
  GA_googleFetchAds();
</script>

<!-- body -->
<script type='text/javascript'>
  GA_googleFillSlot("tagging_test");
</script>

With the Google Publisher Tag:

<!-- head -->
<script type="text/javascript" src="http://www.googletagservices.com/tag/js/gpt.js"></script>
<script type="text/javascript">
  googletag.defineUnit('/1234567/ca-pub-4979655154758341/tagging_test', [728, 90], 'div-gpt-ad-1')
    .addService(googletag.pubads());
  googletag.pubads().setTargeting('Gender', 'Male');
  googletag.pubads().setTargeting('Interest', 'Cars');
 googletag.enableServices();
</script>

<!-- body -->
<div id="div-gpt-ad-1"; style="width: 728px; height: 90px">
 <script type="text/javascript">
   googletag.display('div-gpt-ad-1');
 </script>
</div>

Note that the length of the tag is not a reflection of its overall load time; in fact, you can expect faster performance and load time from Google Publisher Tags than from GAM tags. Asynchronous tags are even faster: the pages continue rendering and loads the ads into iframes when the creatives are returned from the server.

 

There are multiple GPT modes. The code above is just one example. See Sample Google Publisher Tags for more.

How does the Google Publisher Tag work?

The Google Publisher Tag is used to define available ad slots on your organization's website/network. Placing a tag on a page creates a communication path between the ad server and a user’s browser. When a page containing a Google Publisher Tag is rendered, the following sequence of events occurs:

  1. A request is made from the user's browser to the ad server for gpt.js, the tagging JavaScript.

  2. The tagging JavaScript builds and sends one or more requests (depending on whether single-request mode is enabled) to the ad server for ads tagged on the page.

  3. The ad server recognizes the ad units and any custom targeting contained within the request.

  4. The ad server selects and returns the best matching ad.

  5. The JavaScript code associated with the ad tag displays the ad on the page.

 

Does the Google Publisher Tag work with https:// secure pages?

Yes. The Google Publisher Tag works automatically with secure webpages whose URLs begin with https://. There's no need to modify the tag in any way for serving on a secure page.

About https://

HTTPS stands for HyperText Transfer Protocol Secure. It's a communications protocol that's built on top of the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. These protocols encrypt certain elements of the communication between the server and the client in order to prevent tampering and eavesdropping by third parties.