Use GPT passbacks

Traffic remnant line items or serve ads on another publisher's website

Google Publisher Tag allows you to generate tags with “passback” functionality. These tags can be used in any situation where an ad request to a third party should ultimately be filled by an ad trafficked in your own Ad Manager network.

Use passback tags to traffic remnant or fallback line items

Passback tags can be used when a third-party server doesn't have an ad to serve or when an ad doesn't meet the minimum CPM/floor price agreed upon with the third party. In these cases, the third-party server instead serves the GPT passback tag, which returns a house ad or other remnant ad from your own Ad Manager network.

See an example

If third-party ad network A wants to return an ad to Ad Manager publisher B, but does not have an eligible ad, ad network A delivers a passback tag. This passback tag will then return an ad from the Ad Manager ad server to publisher B which matches the targeting criteria.

  1. The webpage makes a call to the Ad Manager ad server using the Ad Manager ad tag.
  2. The Ad Manager ad server returns an ad containing a third-party ad tag.
  3. The third-party ad tag calls the third-party ad server for an ad.
  4. The third-party ad server does not have an eligible ad, so returns a passback ad tag.
  5. The passback ad tag makes a call to Ad Manager to serve an ad matching the specified targeting criteria.
  6. The Ad Manager ad server returns an ad that matches the passback ad tag targeting criteria.

Use passback tags to serve ads on another publisher's website

Passback tags can be used to serve ads from your network to another publisher's website. In these cases, the GPT passback tag would be trafficked by the other publisher and would return an ad from your own Ad Manager network.

See an example

If Ad Manager network A wants to deliver ads to publisher B, Ad Manager network A sends a passback tag to publisher B. Publisher B serves the passback tag, which ultimately returns an ad from Ad Manager network A.

  1. The passback ad tag makes a call to Ad Manager to serve an ad matching the specified targeting criteria.
  2. The Ad Manager server returns an ad that matches the passback ad tag targeting criteria.

Use passback tags to serve video ads

To create video passbacks, use a standard video tag to pass back from a third party to Ad Manager. You can build this tag manually or by using the Ad Manager video tag generator.

Create GPT passback tags

Passbacks now use the Google Publisher Tag API with no additional functions needed. Use of definePassback() and defineOutOfPagePassback() is discouraged, because they behave synchronously and may be blocked by certain browsers in the future.

The GPT snippet must be rendered in an iframe to prevent the passback from inheriting any page-level settings from any other GPT instance running on the publisher page.

Example code

<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<div id='gpt-passback'>
  <script>
     window.googletag = window.googletag || {cmd: []};
       googletag.cmd.push(function() {
         googletag
           .defineSlot('/123/sports', [300, 250], 'gpt-passback')
           .addService(googletag.pubads());
         googletag.pubads().set('page_url', 'mydomain.com/mypage.html');
         googletag.enableServices();
         googletag.display('gpt-passback');
     });
  </script>
</div>

Set page URL

Because it is served in an iframe, GPT may not be able to determine the URL where the tag is being served. If you are using Ad Exchange or AdSense to fill these passback impressions, then without a URL, these systems can't send contextual information about the page to buyers. This can lead to lower fill rates or lower CPMs (and in some cases, rejected ad requests). To avoid this, we recommend that you have your third-party network or ad server append .set("page_url", "URL") to the passback tag.

To pass the URL to a third-party ad network or ad server, use the PATTERN macro (for example, %%PATTERN:url%%) to insert the URL in a third-party tag.

See an example

Here’s an example of how the URL would flow using the PATTERN macro.:

  1. A user visits mydomain.com/mypage.html. The page requests ads.
  2. Ad Manager serves a third-party network tag and inserts a URL using the PATTERN macro.
  3. The third-party network receives the URL, but can't fill it.
  4. The third party serves the Ad Manager passback into its own iframe, but appends .set("page_url", "URL") to the request. 
  5. Ad Manager receives an ad request with the page URL. Ad Exchange and AdSense can send buyers contextual information.

Add click tracking to the tag

If your partner wants to add click tracking to the GPT tag, they'll need to add a clickthrough URL macro, .setClickUrl(). The clickthrough URL will be dynamically prepended to the clickthrough URL stored on the Ad Manager ad server.

See example code

Example code

<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<div id='gpt-passback'>
  <script>
     window.googletag = window.googletag || {cmd: []};
       googletag.cmd.push(function() {
         googletag
           .defineSlot('/123/sports', [300, 250], 'gpt-passback')
           .addService(googletag.pubads())
           // Add click tracking
           .setClickUrl("%%CLICK_URL_UNESC%%");
         googletag.pubads().set('page_url', 'mydomain.com/mypage.html');;
         googletag.enableServices();
         googletag.display('gpt-passback');
     });
  </script>
</div>

Add key-values to the tag

To add key-values to the GPT tag, call .setTargeting("key", "value").

See example code

Example code

<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<div id='gpt-passback'>
  <script>
     window.googletag = window.googletag || {cmd: []};
       googletag.cmd.push(function() {
         googletag
           .defineSlot('/123/sports', [300, 250], 'gpt-passback')
           .addService(googletag.pubads())
           // Add targeting for "color" and "sport" keys
           .setTargeting("color", "red");
           .setTargeting("sport", ["rugby", "rowing"]);
         googletag.pubads().set('page_url', 'mydomain.com/mypage.html');;
         googletag.enableServices();
         googletag.display('gpt-passback');
     });
  </script>
</div>

GPT Passback API

If you want to use a passback from a 3rd party ad server, use a standard Google Publisher Tag written into an iframe, as demonstrated in Create GPT passback tags.

We recommend replacing passback functions, definePassback() and defineOutOfPagePassback(), as this code may break in the future due to changes in the Chrome browser.

Was this helpful?
How can we improve it?