-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Handle Speculation Rules Prerender page activation in Prebid.js #12724
Comments
I'd love the opportunity to speed things up but I'm not sure how Prebid could use this. The only pre-renderable "pages" I can think of are creatives, which we load and show as soon as we have enough info to do so. Is there a use case I'm missing? |
Hi Demetrio, thanks for your answer, please let me better elaborate the situation here to highlight what may be happening. Speculation Rules is used by Publishers or Developers in general, not by AdTech, the issue is that its usage can cause unnecessary requests to prebid being sent. Scenario:
Issue: Page B was fully loaded, running Prebid.js Action but for no reason because the page never became active. Desired scenario:
Let me know if this example is intuitive enough, happy to build a small demo if helpful. Gil |
Why is it desired? Wouldn't it defeat the purpose of prerendering and worsen UX? Either way, we could make it optional - it looks relatively easy to implement. |
Hi Demetrio, you are right, I am not yet sure what is the desired scenario, as you said it depends. Speculation Rules Prerender impacts the page prerendering first but also positively influence the Ads KPIs dynamic, beacuse the Ad request chain would trigger earlier than without it. Some Ad Tech decided not to do anything until the page is activated (like GPT) but others may not have the same issues or may take another approach. If running Auctions on page loads that may never become user visible is not a concern I guess there might not be issues while running Prebid.js on prerendered pages before activation but I guess it would still mean running more auctions than normal and perhaps impacting Inventory KPIs. I can provide some demos and real live examples if you would like to discuss it better. Thanks for your feedback and help as always Demetrio! |
We'll go ahead and implement Chrome's suggestions by default, but also implement an override for publishers. We won't consider the change that considered the prerendering status as breaking and it can be in a minor version. We should add a logInfo message describing current state in debug mode. |
Proposal:
|
Thanks both @dgirardi and @patmmccann for the feedback! One small suggestion, I think it would be better to listen to document.prerendering triggers when the page is prerendered but invisible, that is the best place to handle this at pbjs.que.
More info here: https://developer.chrome.com/docs/web-platform/prerender-pages#impact-on-analytics |
Hello everyone, since version 109 Chrome has introduced support to Speculation Rules Element that allow developers or publishers to prefetch or prerender next page navigations before the user clicks on links.
You can read about the technology here: https://developer.chrome.com/docs/web-platform/prerender-pages
The Prerender logic is great as it fully load the target page into an invisible tab, including running JS etc.
The possible issues may come if Analytics or Ads providers (such as Prebid.js) may run on an Inactive tab that may never be visited by the user.
It's definitively possible that more and more publishers will start to adopt this technology leading to some data measurement issues on 3Ps that have not implemented the necessary logic.
In the article here it's possible to view the suggested way to handle this.
In a nutshell a Prerendered page as
document.prerendering = true
, and there is an eventprerenderingchange
that could be used by 3Ps to intercept when the page becomes active to trigger some logics.For example, Google Publisher Tag (GPT) and AdSense, as well as Google Analytics and other 3Ps are using this method to avoid triggering either PageView for GA or the Ad Request in the case of GPT.
I think it would be ideal for Prebid.js library to decide what to do here, an internal implementation logic in Prebid.js would make it possible for publishers to speed up pages, anticipate Ad Requets, improve Ads KPIs without messing up with metrics from the pages that may never become active.
Hope you appreciate the suggestion here.
Gilbert0
The text was updated successfully, but these errors were encountered: