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

Incorrect bidRequestsCount for bids with Twin AdUnits. #12522

Closed
Pratik733 opened this issue Nov 29, 2024 · 6 comments
Closed

Incorrect bidRequestsCount for bids with Twin AdUnits. #12522

Pratik733 opened this issue Nov 29, 2024 · 6 comments
Labels

Comments

@Pratik733
Copy link

Type of issue

Bug

Description

bidRequestsCount shows incorrect count when a Twin-Adunit is mapped. This happens when a bidder receives multiple bids with same adUnitCode within an single auction.

Test page

Js fiddle Links :-

  1. Twin Adunit - https://jsfiddle.net/wavy6t3x/
  2. Normal Adunit - https://jsfiddle.net/ojq0fx3e/ Use the following code in console to get "bidRequested" event
console.table(window.pbjs.getEvents()
    .filter((ev) => ev.eventType === "bidRequested")
    .map(e => e.args.bids).flat()
    .map(({bidder, bidRequestsCount}) => ({bidder, bidRequestsCount})))

Results

bidder normal adunit bidRequestCount twin adunit bidRequestCount
appnexus 1 3
medianet 1 3
ix 1 3

Expected results

  • The bidRequestsCount for each unique bid Object should be 1 for first Auction. If there are multiple bid Object even though they contain same adUnitCode, each should have its own counter reflecting the appropriate bidRequestsCount.

Actual results

  • The bidRequestsCount value is seen to be 3 for all bids.

Proposal

  1. Unique Identification for Each AdUnit (Even with Shared AdUnitCode):
    • Each adunit Code's auction count should be incremented only once for every GAM refresh() irrespective of the twinAdunits it might have.
  2. Rename bidRequestsCount to adUnitAuctionCount:
    • The metric bidRequestsCount currently gives impression that it is a counter for number of bid request invocations for a given adUnit.
    • If the metric is intended to track auction participation rather than individual bid requests, renaming it to adUnitAuctionCount would improve clarity.
@patmmccann
Copy link
Collaborator

patmmccann commented Dec 2, 2024

Unclear if this is a bug, #4448 calls it the number of requests and IX and sharethrough and Yahoo all have the ability to have multiple requests with different placements on an ad unit, without the need to even have twins.

Perhaps a third option, expose a new metric with a new name meeting your proposal item 1 definition: "Each adunit Code's auction count should be incremented only once for every GAM refresh() irrespective of the twinAdunits it might have." ?

The problem is this ties us to gam, so perhaps requestBids

@patmmccann patmmccann moved this from Triage to Needs OP in Prebid.js Tactical Issues table Dec 2, 2024
@dgirardi
Copy link
Collaborator

dgirardi commented Dec 2, 2024

If there are multiple bid Object even though they contain same adUnitCode, each should have its own counter reflecting the appropriate bidRequestsCount.

I'm not sure we can do this reliably without asking publishers some other identifier to distinguish twins of an ad unit. The second auction could have the same ad unit appear with a different set of twins.

@Pratik733
Copy link
Author

@patmmccann @dgirardi
We, at Media.net raised this change (PR #2940) a while back, assuming the bidRequestCounter for an adUnit serves as the auctionCounter. We missed considering the twin adUnit cases, which are now leading to the erroneous scenarios mentioned above in the issue. Original idea was to increment the auction count regardless of any twin adUnits it might have.

@patmmccann patmmccann moved this from Needs OP to Ready for Dev in Prebid.js Tactical Issues table Dec 3, 2024
@patmmccann
Copy link
Collaborator

We're not sure if anyone relies on the current definition, marking ready for dev to implement a new metric with the proposed definition

@Pratik733
Copy link
Author

@patmmccann
Should we go ahead and raise a PR implementing a new metric i.e auctionCount at slot level?

@patmmccann
Copy link
Collaborator

patmmccann commented Dec 4, 2024

Please do, also please document both metrics and attach the docs pr to your js pr. Thank you! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

3 participants