Google Publisher Tag is a customizable tag by Google Ad Manager that enables publishers to place personalized ads based on size, layout, and targeting.

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 the browser to the ad server looking for tagging JavaScript or gpt.js.
  • Next, gpt.js generates ad request(s) and forwards it to the 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 load 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:

  1. Sign in to the Google Ad Manager account.

  2. Go to Inventory > Ad units and choose the ad unit for which you wish to generate the ad tag.

  3. On the right side of the page, click Generate tags.

  4. Select Google Publisher Tag and continue.

  5. 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'
    var googletag = googletag || {};
    googletag.cmd = googletag.cmd || [];

    googletag.cmd.push(function() {
     googletag.defineSlot('/AccountID/APAdX//Ad_unit_name', [300, 250],

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

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


1. What is Google Publisher Tag?

Publishers can define inventory, initiate and bundle ad requests, and render matching demand using Google Publisher Tag (GPT). Upon receiving key details from you (such as ad unit code, ad size, and key-values), GPT builds the request and displays the ad.

2. Why are Google tags important?

Tags are snippets of code or tracking pixels from third-party tools. These tags tell Google Tag Manager what to do. Examples of common tags within Google Tag Manager are: Google Analytics Universal tracking code or GA4 tracking code.

3. Why do I need Google tags?

A Google tag (gtag.js) allows you to use a variety of Google products and services on your website. Rather than managing multiple tags for different Google product accounts, you can use the Google tag across your entire website.


Shubham is a digital marketer with rich experience working in the advertisement technology industry. He has vast experience in the programmatic industry, driving business strategy and scaling functions including but not limited to growth and marketing, Operations, process optimization, and Sales.

Write A Comment

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

Recent Posts