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 todisplay
the ad slot. If the call todisplay
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
- Add back legacy DFP example. Update instant load method to mitigate issue #419 - race condition fix. — committed to prebid/Prebid.js by mkendall07 8 years ago
- Add back legacy DFP example. Update instant load method to mitigate issue #419 - race condition fix. (#569) — committed to prebid/Prebid.js by deleted user 8 years ago
- Add back legacy DFP example. Update instant load method to mitigate issue #419 - race condition fix. (#569) — committed to sonobi/Prebid.js by deleted user 8 years ago
- Add back legacy DFP example. Update instant load method to mitigate issue #419 - race condition fix. (#569) — committed to sonobi/Prebid.js by deleted user 8 years ago
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).