Cleanest way to get the winning bidder/priority order?
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!
Silly me, have finally come across onEvent('bidWon', callback) for getting the winner. Leaving this open in case anyone can answer the second question^.
@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 great, thanks for the info.