-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Feature: adUnitBidLimit #3906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: adUnitBidLimit #3906
Conversation
Object.keys(bidsByBidder).forEach(key => bucketBids.push(bidsByBidder[key].reduce(highestCpmCallback))); | ||
// if adUnitBidLimit is set, pass top N number bids | ||
if (adUnitBidLimit > 0) { | ||
bucketBids.sort((a, b) => b.cpm - a.cpm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see the bid list randomized before sorting so that aardvark
doesn't always win ties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been told that the order of the list is chronological by time of bid response. This is ok.
@mkendall07 - would like you to take a look at this one:
|
Also - it's arguable -- at least worth discussing -- that deals should be given priority over bids with higher priority. I would propose something like:
|
@r-schweitzer -- we're proposing the following:
proposed config:
|
Ryan and I discussed in slack -- I think randomizing is the best way to go because it will resolve any question about ties and what order the bids are in now. Apparently the list isn't in alpha-order, but it's not clear what order they're in. If they're in "first responded" order, that could be a defendable story. But if they're in "last responded" order, that would be bad. And in general, depending on the order of that list not changing might be risky. |
Ryan found that the bid array order is based on timestamp when the bid returned. My preference is that we still go ahead and randomize the list before picking the Top N.
@mkendall07 - are you good with this? |
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. |
I just wanted to bring this back to everyone's attention. Should we be randomizing the bid array or is it fair that the bidder who responds the quickest with the higher CPM be listed first? |
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. |
While I prefer randomizing from an algorithm perspective, I can accept the response-based ordering as long as we put a comment in somewhere to that effect. We don't really need to weigh down the browser with a sort for this edge case. |
I'd prefer to keep the order as it reflects first in, first out. I'm good with keeping the scope small here and dealing with deal ids separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change LGTM, but needs a test case. Thanks
@r-schweitzer |
024aa59
to
074d42b
Compare
074d42b
to
4e8436d
Compare
Just needs a docs PR |
Type of change
Description of change
#3888
Prebid.js will offer a new config setting that will cap the number of bids made per ad unit when sendAllBids is enabled. This limiter setting will be called adUnitBidLimit which will be defaulted to zero which will allow sendAllBids to function normally. When the adUnitBidLimit is set to anything above 0, e.g. 2, only the targeting for the top 2 bids will be sent to the ad server for each adunit based on CPM.
An example of the setting:
pbjs.setConfig({ adUnitBidLimit: 2 })