Prebid.js: pbjs.getAllWinningBids() not working correctly

Created on 7 Mar 2018  路  8Comments  路  Source: prebid/Prebid.js

Type of issue

bug

Description

Calling pbjs.getAllWinningBids() will not work correctly if you have auctions that have multiple adUnits and therefore have multiple winners. I think the issue resides with the logic in auction.js here: https://github.com/prebid/Prebid.js/blob/master/src/auction.js#L200

An auction instance only allows for setting and getting a singular winning bid when it should allow for multiple winning bids.

Also while looking into this I noticed that auction.setWinningBid and auctionManger.getAllWinningBids all function around calls to pbjs.renderAd, which is somewhat confusing since it's a different code path than what is used in targeting for getting winning bids. I think either pbjs.getAllWinningBids() should use a similar code path that is used in targeting.getWinningBids to eliminate the possibility of discrepancies between the two OR pbjs.getAllWinningBids() should be renamed to eliminate confusion, maybe pbjs.getAllRenderedBids() or something?

Steps to reproduce

Create an auction with multiple adUnits and call pbjs.getAllWinningBids() after the auction has ran.

Expected results

It returns all of the bids rendered.

Actual results

It returns the last bid rendered.

Other information

This causes the issues highlighted in #2190

Most helpful comment

After discussing, I think we've decided that, to help prevent discrepancies and confusion around naming, pbjs.getAllWinningBids() should be renamed to pbjs.getAllRenderedBids(). The old function can stay around with a deprecation warning.

All 8 comments

After discussing, I think we've decided that, to help prevent discrepancies and confusion around naming, pbjs.getAllWinningBids() should be renamed to pbjs.getAllRenderedBids(). The old function can stay around with a deprecation warning.

Just curious where this is right now ?

@chefbenjamin We will ship this in next release

@jaiminpanchal27 1.6 ?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@jaiminpanchal27 @mkendall07 @snapwich I see that https://github.com/prebid/Prebid.js/pull/2328 is finished. Does the snippet here have to be changed ? http://prebid.org/dev-docs/toubleshooting-tips.html#see-all-bids-in-the-console

also would be good to add a column here which showed if the bid is client side or server side.

@chefbenjamin Snippet should work as it is. Also since it's a core change, it requires 2nd review so it need some more time to be merged.

Yes adding new column makes sense, will update snippet

@jaiminpanchal27 @mkendall07 @snapwich we just pushed 1.8 on a few sites and I can confirm the multiple render issue related to the snippet is fixed. thankyou.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mercuryyy picture mercuryyy  路  5Comments

whatisjasongoldstein picture whatisjasongoldstein  路  6Comments

tpottersovrn picture tpottersovrn  路  5Comments

mthazin picture mthazin  路  6Comments

dugwood picture dugwood  路  4Comments