No DFP call made if adunits array is empty
Type of issue
Bug
Description
In some cases, I need to jump the prebid auction step and call directly DFP. For this purpose, I'm setting the adUnits variable to an empty array (adUnits = [];). But then, the DFP call is not made at all and consequently no ad is displayed
Steps to reproduce
Working demo (with one adUnits) : http://demo.reverso.com/prebid/test/reverso.html Not working (with no adunits) : http://demo.reverso.com/prebid/test/reverso_noadunits.html (the only difference with working demo is line 31 : adUnits = [];
Platform details
Prebid 0.20 Tested on Chrome 57, IE11 and Firefox 52
googletag.pubads().refresh(); can be used to call DFP directly if that fits your use case. pbjs.addAdUnits([]) preventing the call as in your example page does seem like a bug, will investigate. PRs always welcome, thanks for the report
Hello @matthewlane,
googletag.pubads().refresh(); is reached in sendAdserverRequest method because if I set a breakpoint in Chrome on line 87, it stops by. I don't see where else could I put a .refresh() call in order to call DFP at page load. Interesting thing is that when it stops at the breakpoint, when I resume, the DFP call is made. So it looks like a time issue.
Thank you
Hello @matthewlane, do you have any update about this issue? Thank you.
Hello @matthewlane,
Any chance this bug could be fixed in a future releasE?
Thank you
Hi, looked at this again and don't currently have a fix.
Stopping at the breakpoint you mentioned and seeing the DFP call made is a good clue that it's a timing issue. Looks like on the working demo, targeting is set and then the auction is cleared, whereas on the non-working demo, the auction is cleared and then targeting is set.
On the non-working demo, line 77, changing sendAdserverRequest to null might work depending on your use case, as this function will then get called by the setTimeout on 92. If a fix gets created I'll link to this issue for notification. Pull requests always welcome
Hi, I have the same problem and have a theory why this happens.
If the adUnit is empty, then the bidsBackHandler is called almost immediately, so that the registerSlot and display is not done yet. I can test it by setting the breakpoints and see which is called first.
I'd characterize this as a DFP bug more than anything. We cannot detect conditions such as these that prevent the DFP call from going out. DFP should be able to figure out that it has a queued request but it's not. Closing out for now unless someone has an idea how to resolve.