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

Rejected bids can sometimes still win auctions / improving distinction between rejected and accepted bids #8956

Closed
dgirardi opened this issue Sep 6, 2022 · 0 comments · Fixed by #9013

Comments

@dgirardi
Copy link
Collaborator

dgirardi commented Sep 6, 2022

Type of issue

Bug / Improvement

Description

There are 3 instances where Prebid can decide to reject a bid, and all of them are done in different ways:

  1. a bid is deemed not valid by core (does not contain required fields, some fields have invalid values, etc): in this case, the invalid bid "disappears" as soon as it's returned by the adapter - there is no BID_RESPONSE event for, it's not returned by pbjs.getBidReponses(), cannot be rendered with pbjs.renderAd, and so on.
  2. a bid does not meet the floor - in this case, it's replaced with a similar bid, except that the new bid has {cpm: 0, status: BID_REJECTED} and bid.getStatusCode() returns NO_BID.
  3. some error happens during currency conversion - in this case, the bid is replaced with an essentially empty bid that has bid.getStatusCode() === NO_BID (unlike the floors case, we do not preserve properties from the original bid such as mediaType, width, height, etc)

The approach taken for cases 2 and 3 makes some version of the rejected bids available to analytics (or other event listeners), but has the disadvantage of requiring every consumer to always check getStatusCode() for every bid. Most of the codebase does not do so; notably:

  • our targeting logic does not look at the bid status, if a publisher allows zero cpm bids through bidderSettings.standard.allowZeroCpmBids, and all bids for an auction are rejected, we are happy to set up targeting for rejected bids.
  • rejected bids are still passed along to bidsBackCallback, so implicitly we are asking publishers to also check getStatusCode() on each bid we pass to it, but I don't believe that is documented anywhere. There is also a separate bid.status property which is also not well documented (here for example we do not list "bidRejected" as one of its possible values).
  • similarly,pbjs.getBidResponses() will include rejected bids.

Proposal

When a bid is rejected:

  • Emit a new event, 'bidRejected', with the original, unmodified bid and a rejection reason;
  • Collect rejected bids (and rejection reasons) into a new bidsRejected property of auction objects - in the style of the current bidsReceived
  • Have a transition period where we replace the rejected bid with a "NO_BID" bid, with cpm = 0 and no creative, like priceFloors does now; this should be uniform for all rejections;
  • Update targeting logic and publisher API (bidsBackCallback, pbjs.getBidResponses(), etc) to filter out the "fake" bids generated this way;
  • Deprecate the use of BID_RESPONSE as a view into rejected bids. Analytics and other consumers should use the new BID_REJECTED event instead;
  • on a major version release, stop generating "NO_BID" bids for rejected bids. At this point, auction.bidsReceived would only contain valid, accepted bids.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
1 participant