Not checking whether the slot came back empty
GPT returns null when the page does not support an interstitial. Your code needs to check this before using the slot.
Implementation guide
Web interstitials
A full-page Ad Manager ad that GPT shows on page change and other triggers, with a clear exit and a frequency cap.
Understand it in 1 minute
The web interstitial is a full-page Google Ad Manager ad. It appears at moments of pause, such as when the person clicks a link to go to another page of the site. Think of a soap opera break: the story stops for a moment, the commercial comes in and then the story continues. The person does not lose what they were reading, because the ad comes in during the move from one page to another.
GPT takes care of everything. It is the Google Publisher Tag, the Google code that requests and shows ads on the site. You just request an interstitial type slot, which is the ad space. GPT creates its own little box, picks the right moment and shows the ad. The trigger that is always on is the click on a link. There are others: returning to the site's tab, clicking the browser's navigation bar on desktop, reaching the end of the article, staying still for 30 seconds and then moving, and using the back button. They can be turned on in the network settings or in the code.
Google says the interstitial was made to follow the Better Ads Standards and comes with three protections for visitors: a clear exit, a frequency cap you can adjust and respect for Google Search's rules on intrusive ads. The default cap is 1 ad every 10 minutes for each person, and it can go down to 1 every 1 minute. Even when several triggers happen, the cap is respected.
It fits sites where people go through several pages. One important detail: the interstitial uses the browser's local storage to control frequency. Those who use the IAB TCF, a consent standard used in Europe, need consent for Purpose 1. Since November 4, 2024, people who did not give consent for local storage can also see the ad, unless you require that access with a code option.
Step by step
Implemented example
<!-- No head -->
<script async
src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"
crossorigin="anonymous"></script>
<script>
window.googletag = window.googletag || { cmd: [] };
googletag.cmd.push(() => {
const interstitialSlot = googletag.defineOutOfPageSlot(
"/1234567/exemplo",
googletag.enums.OutOfPageFormat.INTERSTITIAL,
);
// Volta null se a página ou o aparelho não aceitar intersticial
if (interstitialSlot) {
interstitialSlot.addService(googletag.pubads()).setConfig({
interstitial: {
// Acionadores opcionais (o clique em link já vem ligado)
triggers: { navBar: true, unhideWindow: true },
},
});
}
googletag.enableServices();
if (interstitialSlot) {
googletag.display(interstitialSlot);
}
});
</script>
<!-- Link que nunca chama o intersticial (por exemplo, no menu) -->
<a href="https://www.exemplo.com/"
data-google-interstitial="false">Início</a>
<!-- Teste: acrescente #gamInterstitialDemo no fim do endereço -->
<!-- e depois clique num link -->
<!-- Teste de acionador (modelo da ajuda do Ad Manager): -->
<!-- #gamInterstitialTriggerDemo={navigationBar, pageUnhide, -->
<!-- inactivity, endOfArticle, backward} -->What Google recommends
Tips
Watch out
GPT returns null when the page does not support an interstitial. Your code needs to check this before using the slot.
The interstitial uses local storage. With TCF, without consent for Purpose 1, it may not work as expected.
Without the exclusion attribute, every click on the menu can trigger the ad. Google recommends the exclusion precisely for navigation elements.
For reservations, use creatives of 320x480, 300x250 or 336x280, which are the interstitial ad unit sizes.
Yes. The format has a clear exit, and the person can also close it with the browser's back button.
By default, at most once every 10 minutes for each person. You can change it down to once every 1 minute.
No. The interstitial creates its own little box.
Both are full-page and appear between pages, but the vignette is from AdSense, in Auto ads, and the web interstitial is from Ad Manager, through GPT.
Library
Everything on this page follows Google's official documentation. Read it straight from the source:
The audit reads the site as a visitor would, without clicking anything, and shows what to fix.