Display a web interstitial ad

This example demonstrates how to display a web interstitial ad using the Google Publisher Tag (GPT) library. Web interstitials are GPT-managed, full-page ads that appear between page views. For more information about web interstitials, see Traffic web interstitials.

Usage notes

  • To ensure an optimal user experience, GPT only requests web interstitial ads on pages that properly support the format. Currently, web interstitials are only supported when GPT is running in the top window. On pages that do not support web interstitials, defineOutOfPageSlot() may return null. Be sure to check for this to avoid errors.

  • Only request web interstitial ads on pages or environments where you want an interstitial to appear. Web interstitial ads are eligible to serve to desktop, tablet, and mobile devices.

  • Web interstitial ads generate their own ad slot. Unlike other ad types, you do not need to define a <div> for web interstitial ads. These ads automatically create and insert their own container into the page when an ad fills.

  • Web interstitial ads have a fixed frequency cap. This prevents the same user from being shown an interstitial more than once per hour, per subdomain.

  • Web interstitial ads require access to local storage. For publishers integrated with the IAB Transparency and Consent Framework v2.0, this means that consent for Purpose 1 is required for web interstitial ads to function.

  • If using single-request architecture (SRA) on a page with multiple slots, don’t call display() until static ad slots divs are created. As explained in Ad Best Practices, the first call to display() requests every ad slot defined prior to that point. Although web interstitial slots do not require a predefined <div>, static ad slots do. Calling display() before these elements are present on the page can result in lower quality signals, reducing monetization. Because of this, we recommend delaying the initial call until after the static slots are defined.

Sample implementation

View demo