Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPT interstitial support - deferred rendering #10594

Closed
ourcraig opened this issue Oct 11, 2023 · 3 comments · Fixed by #11914
Closed

GPT interstitial support - deferred rendering #10594

ourcraig opened this issue Oct 11, 2023 · 3 comments · Fixed by #11914

Comments

@ourcraig
Copy link

Type of issue

Feature Request

Description

Currently when the Prebid Universal Creative is returned from Google Ad Manager for an out-of-page GPT interstitial slot, it renders instantly despite not being viewable. Prebid recommends the use of adUnit.deferredBilling: true to defer the onBidBillable event from firing on ad render, and calling pbjs.triggerBilling(<deferredBid>) to fire the onBidBillable event when the interstitial becomes viewable. However, it seems that bid adapters are not currently listening for the onBidBillable event (ref).

To have wider support for GPT interstitials, I would like to request Prebid support for deferred rendering using something like the below:

<script src = "https://cdn.jsdelivr.net/npm/prebid-universal-creative@latest/dist/%%PATTERN:hb_format%%.js"></script>
<script>
  var ucTagData = {};
  var render = function() {
    try {
      ucTag.renderAd(document, ucTagData);
    } catch (e) {
      console.log(e);
    }
  }
  ucTagData.adServerDomain = "";
  ucTagData.instl = "%%PATTERN:hb_instl%%";
  ucTagData.pubUrl = (ucTagData.instl === "true") ? "*" : "%%PATTERN:url%%";
  ucTagData.adId = "%%PATTERN:hb_adid%%";
  ucTagData.cacheHost = "%%PATTERN:hb_cache_host%%";
  ucTagData.cachePath = "%%PATTERN:hb_cache_path%%";
  ucTagData.uuid = "%%PATTERN:hb_cache_id%%";
  ucTagData.mediaType = "%%PATTERN:hb_format%%";
  ucTagData.env = "%%PATTERN:hb_env%%";
  ucTagData.size = "%%PATTERN:hb_size%%";
  ucTagData.winurl = "%%PATTERN:hb_winurl%%";
  ucTagData.winbidid = "%%PATTERN:hb_bidid%%";
  ucTagData.mobileResize = "hb_size:%%PATTERN:hb_size%%";
  ucTagData.requestAllAssets = true;
  ucTagData.clickUrlUnesc = "%%CLICK_URL_UNESC%%";
  if (ucTagData.instl === "true") {
    window.addEventListener('message', function(event) {
      try {
        var data = JSON.parse(event.data);
        if (data.type === "rewarded" && data.message === "visible") {
          render();
        }
      } catch(e) {
      	console.log(e);
      }
		});
  } else {
    render();
  }
</script>

This example PUC checks for hb_instl:true and uses it to defer the rendering until GPT fires the impressionViewable event.

Test page

pbjs-instl-tests

  • deferred-render shows an example of rendering deferred until the GPT interstitial is triggered

Other information

  • GPT interstitial has a frequency cap of one view per user per hour -- to refresh it use localStorage.clear() on the test page
  • GPT docs for out-of-page interstitial here
@patmmccann
Copy link
Collaborator

patmmccann commented Oct 11, 2023

A couple notes: This feels quite a bit less desirable than pre-rendering from a ux standpoint and will certainly drop the viewability of the units a bunch, and also make the advertiser numbers far from the publisher numbers (which will be by definition 100% if they use GAM). I'd much rather get SSPs to support onBidBillable, and it seems we have some in-roads at Magnite (which is busy re-writing their adapter), Pubmatic (which did the feature, thanks @jlquaccia ), and IX.

Other than a strong desire to move away from the PUC (and this proposal should be fine to just exist in core post-#9647 ), this doesnt feel so horrible, except if it delays or derails the preferred path at leader SSP companies, and it would work universally, instead of just that subset of leaders building support, so that is nice.

Is there a way we could render immediately if onBidBillable support and fallback to defer rendering?

@patmmccann
Copy link
Collaborator

Ideal behavior discussed in the committee seems to be:

if an ad unit is tagged with deferred billing, but the ssp does not support it, treat the markup from that ssp as deferred render. PBS demand would go into the deferred render case until PBS adapter has support for triggerBurl

@patmmccann
Copy link
Collaborator

linking with #5917

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants