Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

No DFP call made if adunits array is empty

Open bboigienman opened this issue 9 years ago • 7 comments

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

bboigienman avatar Apr 21 '17 09:04 bboigienman

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

matthewlane avatar Apr 24 '17 23:04 matthewlane

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

bboigienman avatar Apr 25 '17 09:04 bboigienman

Hello @matthewlane, do you have any update about this issue? Thank you.

bboigienman avatar May 02 '17 13:05 bboigienman

Hello @matthewlane,

Any chance this bug could be fixed in a future releasE?

Thank you

bboigienman avatar Jul 07 '17 10:07 bboigienman

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

matthewlane avatar Jul 07 '17 21:07 matthewlane

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.

0xlee avatar Jul 18 '17 08:07 0xlee

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.

mkendall07 avatar Nov 29 '17 21:11 mkendall07