Google Ad Manager

An Overview of Google Publisher Tag (GPT)

Pinterest LinkedIn Tumblr

Google has always strived to create ad platforms where sellers and buyers can do business without getting bogged down by the technical side of programmatic. And ad tags are the building blocks of any ad platform.

Ad tags are snippets of codes that act as placeholders for ad creatives. Until an ad is provided by the server, the ad tag reserves its place. It enables communication possible between publishers, advertisers, and ad exchanges. Google Publisher Tag (GPT) is one of the most well-document and easy-to-use ad tags. In this post, we’ll explain how Google Publishers Tag works.

What is Google Publisher Tag?

The Google Publisher Tag (GPT) is an ad tagging library for Google Ad Manager that can dynamically build ad requests. GPT takes key details such as ad unit name, ad size, and custom targeting builds the request, and displays the ad on web pages.

Google Developers

Using the GPT framework, publishers can build and customize ad tags based on their requirements for different ad units (including for web- and app-based ads). The granular customization of GPT includes different targeting criteria, synchronous or asynchronous ad calls, custom ad formats, etc.

How Does Google Publisher Tag Work?

GPT provides a channel of communication between the ad server and the user’s browser and enables the site to render ads from Google ad server.

Here’s how Google Publisher tag works:

  • When a user visits the site with GPT, a request is generated from browser to ad server looking for tagging JavaScript or gpt.js.
  • Next, gpt.js generates ad request(s) and forward it to Google ad server.
  • Ad server reads the request to recognize the key values of ad units like ad layout, size, and targeting.
  • Then it starts looking for the best matching ad.
  • Once a match is found, ad server returns the ad code to tagging JavaScript.
  • Then, the tagging JavaScript takes the ad and places it on the available ad unit.

Benefits of Google Publisher Tag

  • Access to Google Publisher Console: GPT comes with Google Publisher Console, which helps publishers troubleshoot minor issues with their ad-enabled webpages and provides tips to troubleshoot them.
  • Reduced page latency:  Asynchronous ad calls loads the ads and content concurrently, thereby ensuring that the content isn’t slowed by ads and vice-versa. However, publishers can set it to synchronous mode too.
  • Multi-level inventory hierarchy: This feature of GPT enables publishers to set multiple line items with desired granularity. Publishers can further create targeting and/or price hierarchy to maximize revenue.
  • Single request architecture (SRA): SRA enables publishers to send a single request to Ad Manager rather than sending multiple requests to the individual ad networks, in order to get their creatives. This in turn saves time and reduces page latency.
  • SafeFrame availability: A SafeFrame enables publishers to place ads without risking any third-party service snooping on site content or user data. This helps publishers show rich media ads without creating security vulnerabilities.
  • Responsive ads: GPT allows responsive ad units, which appear on devices of different display sizes such as desktop and mobile in optimal resolutions without needing multiple line item setup.
  • Cache busting: GPT adds the cache-busting element in order to show ads rendered from ad server rather from the browser cache.
  • Render Macros: Macros are special strings of code that can be added to an ad creative code during delivery to make it perform tasks like expanding on click, track user, display a different image and more.

How to Get Started With GPT?

In order to get started with GPT, you need to have access to Google Ad Manager. Get started with these steps to generate GPT:

  • Sign in to the Google Ad Manager account.
  • Go to Inventory > Ad units and choose the ad unit for which you wish to generate the ad tag.
  • On the right side of the page, click Generate tags.
  • Select Google Publisher Tag and continue.
  • Save the settings and get the code. Place this code to the site.

Google Publisher Tag looks like any other JavaScript code. Ad Manager makes it easy to design. Simply copy-paste the code to HTML source code of the site and GPT will take care of the ad calls and place the ad creatives.

What Does a GPT Look Like?

Here is a sample GPT code:

<!-- To be placed in <head> -->
<script async='async'
    src-'https://www.googletagservices.com/tag/js/gpt.js'></script>
<script>
    var googletag = googletag || {};
    googletag.cmd = googletag.cmd || [];
</script>

<script>
    googletag.cmd.push(function() {
     googletag.defineSlot('/AccountID/APAdX//Ad_unit_name', [300, 250],
    'div-gpt-ad-XXXXXXXXXXXXX-0').addService(googletag.pubads());
    googletag.pubads().enableSingleRequest();
    googletag.enableServices();
    });
</script>

<!-- To be placed in <body> -->
<!-- /AccountID/APAdX//adunitname -->
<div id='div-gpt-ad-1550229350329-0' style='height:250px; width:300px;'>
<script>
    googletag.cmd.push(function()
     {googletag.display('div-gpt-ad-XXXXXXXXXXXXX-0'); });
</script>
</div>

Note: This is a sample code. Your GPT snippet can look different depending on the customizations added to the code.

Write A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.