This article explains how Google Publisher Tag (GPT) works, its key benefits, and how it supports secure pages in Google Ad Manager.
On this page:
About Google Publisher Tag (GPT)
Google Publisher Tag (GPT) is an ad tag library that lets you define inventory, bundle ad requests, and display matching ads on webpages. GPT uses key details from you (such as ad unit code, ad size, and key-values) to build the request and render the ad.
With GPT, you can define shared settings, such as page-level targeting, instead of repeating targeting for each ad. You can also control how and when GPT makes ad requests. For example, you can use single-request architecture (SRA) to call all ads once in your page header.
Google serves the JavaScript files that implement GPT. Do not serve these files from your own server or load them from an unofficial source.
Get started with the GPT developer documentation
How GPT works
You use GPT to define available ad slots in your network. Placing GPT on a page creates a communication path between the ad server and a user's browser. When a user requests a page containing GPT, the following sequence of events occurs:
- The user's browser sends a request to the ad server for
gpt.js, the JavaScript tag code. - The GPT JavaScript builds and sends one or more requests to the ad server for ads tagged on the page.
- The ad server matches the ad units and any key-values contained within the request.
- The ad server runs an auction to select the best-matching creative for the ad unit.
- The ad server returns the matching ad to the GPT JavaScript.
- The GPT JavaScript renders the ad on the page.
Benefits of GPT
GPT provides these benefits:
- Multi-level inventory hierarchy: Google Publisher Tag allows you to use more granular levels of inventory in the Ad Manager interface. With multiple levels of hierarchy, you can create much more specific targeting based on your site content.
- Minimizes page load time impact: Loading JavaScript asynchronously lets your webpage render without waiting for Ad Manager servers to return the code. Ads load into iframes as soon as the server returns the creatives.
- Google Publisher Console: GPT includes a built-in debugging and support tool called the "Google Publisher Console," available on all pages containing GPT.
- Single request architecture (SRA): Instead of sending individual ad requests to Ad Manager servers, GPT sends one request for all ad units on the page. This is the recommended request mode, as it allows advanced roadblocking and improves page load time.
- SafeFrame capability: SafeFrame technology allows transparent interactions between page content and ads, giving you control while protecting you from untrustworthy creatives and auto-redirects.
- Responsive design: You can use GPT to build ads that fit the browser your visitors use to open your website. This means your ads look good on any device.
- Page-level ad selection: GPT and the ad server work together to keep track of what ads are on the page, so you can define roadblocks, takeovers, and competitive exclusions.
- Reactive ad formats: You can use GPT to build and display web interstitial, anchor, and rewarded ads formats.
- Consent framework integration: GPT communicates with Interactive Advertising Bureau (IAB) Consent Management Platforms (CMPs) to handle and respect user consent for storage usage and personalization. GPT also provides APIs for you to configure privacy settings and limited ads.
GPT & secure pages (HTTPS)
GPT works automatically with secure webpages whose URLs begin with https://. You don't need to modify GPT to serve ads on a secure page.
HTTPS stands for HyperText Transfer Protocol Secure. It's a communications protocol built on Transport Layer Security (TLS) and Secure Sockets Layer (SSL). HTTPS encrypts data between the server and browser to prevent third parties from accessing or changing information.