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

Prebid 12 - pbjs.requestBids - returns all ads, not just ads in paths array.

Open internetchris opened this issue 10 years ago • 23 comments

Hi Group,

I just upgraded to version 12 today and noticed that when I do a request bids on an ad I'm refreshing, it gets bids for all my ads, not just the ad specified in my paths array. Thoughts?

pbjs.que.push(_.bind(function() {
      pbjs.requestBids({
        timeout: PREBID_TIMEOUT,
        adUnitCodes: paths,
        bidsBackHandler: _.bind(function(bidResponses) {
           // bidResponses comes back with all ads, not just the ads in my paths array
        }, this)
      });
    }, this));

In my console I set a breakpoint and put a watch on the paths and the bidResponses

prebid issue

We are currently using version 8 due to some compatibility problems with IE, but with that version it only returns the skyscraper in the bidResponse since that's all I passed in our paths array.

internetchris avatar Aug 31 '16 19:08 internetchris

Checking back on this. Anyone here have a moment to confirm my findings?

internetchris avatar Sep 06 '16 16:09 internetchris

@internetchris I'll take a look at this

mkendall07 avatar Sep 06 '16 16:09 mkendall07

@internetchris Yes it looks like this is an issue. I'm not sure if it was working properly before or not, but we'll fix it as part of some internal changes we are making to our auction instances.

mkendall07 avatar Sep 06 '16 20:09 mkendall07

Do we think this will be resolved by the release of Prebid 0.14.0?

In addition I would like to add that we do dynamic ad loading as the user scrolls down the page and we call the requestBids() method and run into the same problem.

aforwark avatar Oct 20 '16 17:10 aforwark

The expected behavior currently is you will see the bid data for the most recent auction a placement participated in. For example, for 5 placements on a page, a bid request is made for all five placements, then for four of the five and then for 3. pbjs.getBidResponses will return:

placement auction
1 1
2 2
3 3
4 3
5 3

You can filter these results to report on just the most recent auction. Closing as answered, please reopen with any new info.

protonate avatar Oct 24 '16 23:10 protonate

@protonate This is for the bidsBackHandler param, not pbjs.getBidResponses. I don't think that has been resolved?

mkendall07 avatar Oct 25 '16 01:10 mkendall07

Indeed - thanks for re-opening @mkendall07..... we are really hopeful to see this fixed in v14 - what's the likelihood?

internetchris avatar Oct 25 '16 03:10 internetchris

@internetchris #750 should address the issue. It is expected to be released with Prebid 0.14.0.

protonate avatar Oct 27 '16 22:10 protonate

I've been following the progress of this. If we wanted to use this once it's been merged, it may be reasonable if there hasn't been a bunch of other changes merged since releasing 0.14.0. I will keep a close eye on it.

internetchris avatar Nov 02 '16 18:11 internetchris

@internetchris @aforwark #750 is now updated and should fix the issues you've reported. If you are able to test the PR branch for your use case let us know.

protonate avatar Nov 06 '16 06:11 protonate

I will give this a test tomorrow. Thanks!

Sent from my iPhone

On Nov 6, 2016, at 12:40 AM, Nate Cozi [email protected] wrote:

@internetchris @aforwark #750 is now updated and should fix the issues you've reported. If you are able to test the PR branch for your use case let us know.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

internetchris avatar Nov 06 '16 14:11 internetchris

@protonate I'm late to the party but just confirming this is working great now, thank you!

aforwark avatar Nov 15 '16 22:11 aforwark

@aforwark glad to hear it, thanks for the update.

protonate avatar Nov 15 '16 23:11 protonate

@protonate - I may be missing something but if I simply pass a single path

  pbjs.requestBids({
        timeout: PREBID_TIMEOUT,
        adUnitCodes: ['/mypath'],
        bidsBackHandler: _.bind(function(bidResponses) {
          console.log('bidResponses', bidResponses);

I don't get any bidResponses. Is there something new I must do? I just built v0.15.0

internetchris avatar Nov 18 '16 20:11 internetchris

You do have an adUnit defined for '/mypath'?

protonate avatar Nov 18 '16 20:11 protonate

yep: screen shot on 2016-11-18 at 13-54-02

Code snippet:

    console.log('pbjs.adUnits', pbjs.adUnits);
    console.log('paths', paths);

    pbjs.que.push(_.bind(function() {
      pbjs.requestBids({
        timeout: PREBID_TIMEOUT,
        adUnitCodes: paths,
        bidsBackHandler: _.bind(function(bidResponses) {
          console.log('bidResponses', bidResponses);

internetchris avatar Nov 18 '16 20:11 internetchris

Here's a little more output with the pbjs_debug...

sample-prebid

sample-prebid2

internetchris avatar Nov 18 '16 21:11 internetchris

cc/ @mkendall07 - looping you into this conversation too, I know you handled reproducing my original issue. I'm hoping I'm just being dense about this.

internetchris avatar Nov 18 '16 22:11 internetchris

Seems like the callback is invoked before the bids have returned, either due to timeout or an issue with bid counts (which we thought had been resolved). Does lengthening the timeout change anything?

protonate avatar Nov 18 '16 22:11 protonate

Extending the timeout didn't have any affect. I tried 5000ms and then for the heck of it 15000ms, the bidResponse/lack of seems immediate.

internetchris avatar Nov 18 '16 22:11 internetchris