Skip to content

Add mobile web interstitial GPT example#6609

Open
patmmccann wants to merge 3 commits into
masterfrom
codex/add-documentation-with-example-for-issue-5917
Open

Add mobile web interstitial GPT example#6609
patmmccann wants to merge 3 commits into
masterfrom
codex/add-documentation-with-example-for-issue-5917

Conversation

@patmmccann

@patmmccann patmmccann commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 354e475ab1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread features/InterstitialAds.md Outdated
Comment on lines +122 to +124
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync([INTERSTITIAL_AD_UNIT]);
googletag.pubads().refresh([interstitialSlot]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid queuing the timeout refresh behind Prebid

In contexts where Prebid.js is slow or blocked, the failsafe timeout can enter this path, but the GAM refresh is still queued on pbjs.que; if the Prebid library never loads, this function never runs, and because disableInitialLoad() was enabled the interstitial slot never makes an ad server request. The standard GPT examples in this repo handle this by checking pbjs.libLoaded and refreshing GPT directly when Prebid is unavailable, so this sample should include the same fallback for timeout-only paths.

Useful? React with 👍 / 👎.

@netlify

netlify Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploy Preview for prebid-docs-preview ready!

Name Link
🔨 Latest commit 7b2a0c7
🔍 Latest deploy log https://app.netlify.com/projects/prebid-docs-preview/deploys/6a290f58ade4e80008be2948
😎 Deploy Preview https://deploy-preview-6609--prebid-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

### Motivation

- Provide a concrete example for pairing a Prebid.js interstitial ad unit with a Google Publisher Tag (GPT) out-of-page interstitial to address Prebid.js issue #5917.
- Clarify the expected flow and signals (including `ortb2Imp.instl`) for bidders and publishers using web interstitials.

### Description

- Added a new "Mobile Web Interstitial with GPT" section to `features/InterstitialAds.md` containing a complete code example that shows a Prebid ad unit, `pbjs.requestBids`, `pbjs.setTargetingForGPTAsync`, and `googletag.defineOutOfPageSlot` usage.
- Introduced a simple guard (`pbjs.interstitialAdServerRequestSent`) in the example to avoid sending duplicate ad server refreshes if the slot is not ready.
- Documented implementation notes covering that `defineOutOfPageSlot()` may return `null`, the use of `googletag.pubads().disableInitialLoad()`, and that `googletag.display()` registers the GPT interstitial slot which only appears when GPT receives a fill and an eligible trigger occurs.

### Testing

- Ran `npx markdownlint-cli --config .markdownlint.json features/InterstitialAds.md` against the edited Markdown file and observed no lint failures.
- Ran `bundle exec jekyll build` to verify the site generates and the build completed successfully.
code: INTERSTITIAL_AD_UNIT,
mediaTypes: {
banner: {
sizes: [[320, 480], [480, 320]]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting that if you go the defineOutOfPageSlot route in GPT, that also doesn't take sizes https://developers.google.com/publisher-tag/reference#googletag.defineOutOfPageSlot

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right but this size is for prebid?

I did another commit with the deferred billing setup, which was our main blocker going line with this in the past for all bidders

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I'm just not totally clear on if defineOutOfPageSlot not taking sizes will mean that we can't actually specify sizes in the GAM request. Like, if we request a 320x480 from the bidder, but there's no size restriction/qualifier on the line item, then should we specify sizes on the prebid side? I might have some of the mechanics wrong here though

### Motivation

- Provide a concrete example and guidance for using Prebid.js with Google Publisher Tag (GPT) web interstitials on mobile, clarifying how the Prebid ad unit `code` maps to the GPT slot and how to signal interstitial demand with `ortb2Imp.instl`.
- Explain practical considerations for GPT out-of-page slots such as `defineOutOfPageSlot()` possibly returning `null`, coordinating Prebid targeting with GPT, and handling fallback timing.

### Description

- Add a new "Mobile Web Interstitial with GPT" section to `features/InterstitialAds.md` that includes a complete sample integration demonstrating `ortb2Imp.instl: 1`, ad unit configuration, `pbjs.requestBids()` usage, and a `sendInterstitialAdServerRequest()` flow.
- Show how to define an out-of-page GPT slot with `googletag.defineOutOfPageSlot(..., googletag.enums.OutOfPageFormat.INTERSTITIAL)`, check for a `null` return, call `googletag.display()` to register the interstitial, and coordinate `pbjs.setTargetingForGPTAsync()` with `googletag.pubads().refresh()`.
- Document the use of `disableInitialLoad()` to prevent GPT from requesting the interstitial before Prebid targeting is set and the timeout-based fallback that refreshes GPT when Prebid times out.

### Testing

- No automated tests were run because this is a documentation-only change.

pbjs.interstitialAdServerRequestSent = true;
googletag.cmd.push(function() {
if (pbjs.libLoaded) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a performance thing, right? Instead of pushing to the prebid que, this short circuits it

googletag.cmd.push(function() {
interstitialSlot = googletag.defineOutOfPageSlot(
INTERSTITIAL_AD_UNIT,
googletag.enums.OutOfPageFormat.INTERSTITIAL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't get this working with Prebid bids.
What line item setup is required to make this work? A minimal ad ops section would make this a full example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration of mobile web interstitial ad with prebid

3 participants