Prebid.js: Prebid stopping lazy load ads from showing

Created on 30 Nov 2016  路  4Comments  路  Source: prebid/Prebid.js

Type of issue


question

Description


An ad is being loaded with the jquery_lazyload library, when the user scrolls to the bottom of the page. If Prebid/AiH is active on the page, lazy-loaded ad does not function.

question

Most helpful comment

I had the same problem, but realized after removing that line to disableInitialLoad, the timing was off with our header bidding. Using the Chrome Extension "Headerbid Expert" showed that DFP was firing immediately, and not waiting for Prebid to return bids, so we were rarely getting winning bids before the ads loaded with DFP.

From what I can tell, Prebid uses disableInitialLoad to hold the DFP push so that it can request bids, and then uses googletag.pubads().refresh(); after it has everything it needs from the bidders or it's hit the timeout that was set. So it seems lazyloaded ads are also being affected by disableInitialLoad, but then are not visible when the google ads refresh so they never actually load.

I resolved this by adding googletag.pubads().refresh(); to the end of my lazyloaded script. However, to avoid refreshing ALL ads again, you need to target just the individual slot that's come into view. Google provides some guidelines for doing this: https://support.google.com/dfp_premium/answer/4578089#slotRefresh

Good luck!

All 4 comments

Do you have a test page or JSFiddle we can look at?

http://chat.georgia.sportswar.com/message_board/ugadawgrun/

The lazy-load ads are 728x90 and show up in the middle, and at the bottom of the forum.

Thanks for looking into this

Solved. Removed:

googletag.cmd.push(function() { googletag.pubads().disableInitialLoad() });

I had the same problem, but realized after removing that line to disableInitialLoad, the timing was off with our header bidding. Using the Chrome Extension "Headerbid Expert" showed that DFP was firing immediately, and not waiting for Prebid to return bids, so we were rarely getting winning bids before the ads loaded with DFP.

From what I can tell, Prebid uses disableInitialLoad to hold the DFP push so that it can request bids, and then uses googletag.pubads().refresh(); after it has everything it needs from the bidders or it's hit the timeout that was set. So it seems lazyloaded ads are also being affected by disableInitialLoad, but then are not visible when the google ads refresh so they never actually load.

I resolved this by adding googletag.pubads().refresh(); to the end of my lazyloaded script. However, to avoid refreshing ALL ads again, you need to target just the individual slot that's come into view. Google provides some guidelines for doing this: https://support.google.com/dfp_premium/answer/4578089#slotRefresh

Good luck!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eyedar picture eyedar  路  6Comments

Rubioli picture Rubioli  路  3Comments

jdwieland8282 picture jdwieland8282  路  5Comments

amelzer picture amelzer  路  6Comments

nyfer picture nyfer  路  5Comments