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

Cleanest way to get the winning bidder/priority order?

Open tomraa opened this issue 10 years ago • 3 comments

It appears there is no method to get the quickly get the winning bidder info straight away in the main callback. Currently I'm using

var oWinnerInfo = pbjs.getAdserverTargeting()[ sMyAdDivId ];

to give me the winning bidder's name and the price bucket. It seems like there should be a method to get the full info directly, or the bidResponses obj which gets passed to bidsBackHandler should mark the winner or priority order somehow. Unless I'm missing something? :)

Backup question: when two bidders bid the same amount, how is the winning decision made? Is response time taken into account?

Thanks to anyone who can provide some info, or tell me to read the code more thoroughly!

tomraa avatar May 25 '16 10:05 tomraa

Silly me, have finally come across onEvent('bidWon', callback) for getting the winner. Leaving this open in case anyone can answer the second question^.

tomraa avatar May 25 '16 23:05 tomraa

@tr-coull for your 2nd question, it's going to be implemented that the bid with a faster response is returned (https://github.com/prebid/Prebid.js/pull/372) for 0.9.x release.

For 0.8.x < release it was automatically sorted based on time to respond (as the bids collected in the array as they are returned).

mkendall07 avatar May 26 '16 18:05 mkendall07

@mkendall07 great, thanks for the info.

tomraa avatar May 31 '16 11:05 tomraa