Skip to content
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

Added bid pool and fixed getAllWinningBids function #2328

Merged
merged 4 commits into from
Apr 10, 2018

Conversation

jaiminpanchal27
Copy link
Collaborator

@jaiminpanchal27 jaiminpanchal27 commented Mar 29, 2018

Type of change

  • Bugfix
  • Feature

Description of change

This PR adds bid pool concept to prebid.js
In case of concurrent auctions, auctionManager can have multiple bids from same bidder for a particular adUnit. While selecting bids to do auction, prebid.js uses following criteria if such multiple bids are found.

  • Do not use bid which is rendered or won earlier auction.
  • Select bid whose ttl is not expired. Here buffer of 200 1000 ms is included in check.
  • Use first in first out. Select the bid which came in first for auction.

Also added new api function getAllPrebidWinningBids which will return the bids won in prebid auction but not rendered by dfp.

Also fixed the bug in getAllWinningBids described here #2238

src/targeting.js Outdated

const MAX_DFP_KEYLENGTH = 20;
const TTL_BUFFER = 200;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make the buffer 1000

Copy link
Member

@mkendall07 mkendall07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. Can you up the buffer amount

@mkendall07 mkendall07 added the needs 2nd review Core module updates require two approvals from the core team label Apr 2, 2018
Copy link
Collaborator

@snapwich snapwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some names look like they could be updated, but overall looks good

src/auction.js Outdated
@@ -197,8 +197,8 @@ export function newAuction({adUnits, adUnitCodes, callback, cbTimeout, labels})
executeCallback,
callBids,
bidsBackAll,
setWinningBid: (winningBid) => { _winningBid = winningBid },
getWinningBid: () => _winningBid,
setWinningBid: (winningBid) => { _winningBids = _winningBids.concat(winningBid) },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems addWinningBid is a more apt name now.

src/auction.js Outdated
setWinningBid: (winningBid) => { _winningBid = winningBid },
getWinningBid: () => _winningBid,
setWinningBid: (winningBid) => { _winningBids = _winningBids.concat(winningBid) },
getWinningBid: () => _winningBids,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and getWinningBids here.

@jaiminpanchal27
Copy link
Collaborator Author

Docs PR here prebid/prebid.github.io#700

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LGTM needs 2nd review Core module updates require two approvals from the core team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants