Clear search
Close search
Google apps
Main menu

Overview of Google Publisher Tags

What is the Google Publisher Tag?

GPT is an ad tagging library with which you can dynamically build ad requests. GPT takes key details from you such as ad unit code, ad size, and key-values, builds the request, and displays the ad on web pages or mobile apps.

What are the benefits of using Google Publisher Tags?

There are multiple benefits of using these 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.

    There are several ways to view the Publisher Console on webpages containing Google Publisher Tags:

    • After loading the page, enter javascript:googletag.openConsole() in your browser’s address bar. You can bookmark this URL for easy access.
    • After loading the page, enter googletag.openConsole() in your browser’s JavaScript console.
    • Before loading the page, append the query string parameter google_console=1 to your page's URL to make the Publisher Console toggleable using a keyboard shortcut (see below) or google_force_console=1 to cause the Publisher Console to display automatically after the page is loaded. For example:

    After you’ve loaded the Publisher Console using any of the above methods, you can subsequently toggle it on or off using the keyboard shortcut Ctrl+F10 (on a Mac, use Function+Ctrl+F10).

    The Publisher 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 UI.

  • 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.

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 key-values 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.

Was this article helpful?
How can we improve it?