Prebid.js: GPT instant load race condition against display() calls

https://developers.google.com/doubleclick-gpt/reference#googletag.PubAdsService_refresh says:

For proper behavior across all browsers, calling refresh must be preceded by a call to display the ad slot. If the call to display is omitted, refresh may behave unexpectedly.

Using the instant load method, if a page is big enough and the client is slow enough, it is possible for the the GPT instant load setup to call refresh() before the inline display() calls are reached. Then when they are, nothing loads into them since they missed the refresh() call. This makes the default instant load approach not tenable for all situations.

Maybe workarounds could involve calling refresh() for a single ad unit, if display() ran too late. Or maybe calling enableServices() later? Not sure what that does exactly though.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (14 by maintainers)

Commits related to this issue

Most upvoted comments

I think this is a bug, not just a question. Until a good solution is available, the docs should be updated to show the “old” (but more reliable) setup also. (Or just go back to the “old” setup if its better to keep the docs simple and only have one set of examples instead of two).