googleads/google-publisher-tag-samples

Sample feedback: basic/display-web-interstitial-ad

Closed this issue · 3 comments

https://developers.google.com/publisher-tag/samples/display-web-interstitial-ad
I have a question about the above sample code

Interstitial did not fire when commenting out enableSingleRequest() in this sample code
Is it possible to fire without executing enableSingleRequest()?
Is enableSingleRequest() always required?

Hi @JunItoMixi!

The sample uses Single Request Architecture (SRA) mode to bundle ad requests for both the interstitial and static slots into a single request. When this mode is active, every ad slot defined before the first call to display() is requested at once. If you disable this mode by commenting out enabeSingleRequest(), then you need a separate call to display() for each ad slot:

<script>
    googletag.cmd.push(function() {
      // With SRA disabled, each ad slot must be requested separately.
      googletag.display(staticSlot);
      googletag.display(interstitialSlot);
    });
</script>

I was able to confirm. Thank you!

Great, glad you were able to get it working!