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

getBidderRequestsCounter cannot parse ad unit codes with too many dots #12204

Closed
hkimmgni opened this issue Sep 4, 2024 · 1 comment · Fixed by #12206
Closed

getBidderRequestsCounter cannot parse ad unit codes with too many dots #12204

hkimmgni opened this issue Sep 4, 2024 · 1 comment · Fixed by #12206

Comments

@hkimmgni
Copy link
Contributor

hkimmgni commented Sep 4, 2024

BUG

getBidderRequestsCounter cannot find the "requestsCounter" when the adunit code contains too many "." (dots). Google Ad Manager GPT allows ad unit codes with more than one dot in the ad unit code.

Description

export function getBidderRequestsCounter(adunit, bidder) {

When it reached getBidderRquestsCounter(), the adunit is being parsed by ".".
So the ad unitgpt-ad-mayoclinic.org-top is broken down as

  • gpt-ad-mayoclinic > org-top > bidders > rise > requestsCounter

instead of

  • gpt-ad-mayoclinic.org-top > bidders > rise > requestsCounter

Steps to reproduce

  1. Open a chrome browser tab
  2. Open Chrome Dev tools
  3. Open the page
  4. Go to console & filter for "INFO: Bids Requested for Auction with id"
  5. Notice, the bidderRequestsCount for Rubicon is 1, but Rise is 0.
    -- Rubicon ad unit code is "test-slot"
    -- Rise ad unit code is "gpt-ad-mayoclinic.org-top.bidders.rise"
  6. Notice, in the network tab there are two bid requests for Rubicon and Rise. Filter for /fastlane|yellowblue/

Test page

https://hyunjoo-test-environment.s3.amazonaws.com/public/github/getBidderRequestsCount/testpage.html?pbjs_debug=true

Expected results

I expected to see bidderRequestsCount to be equivalent to the number of requests in the network tab.

Actual results

I see uneven bidderRequestsCount against the number of requests I see under the network tab.

Platform details

I can see this issue from v8.48.0.

Other information

This is affecting Bidder Rise because Rise is using bids.bidderRequestCount in their bid request payload, here:

loop: bid.bidderRequestsCount || 0,
.
This is also affecting other bidders count.

@robertrmartinez
Copy link
Collaborator

There were a couple other functions in there that needed fixing as well

Address in PR #12206

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

Successfully merging a pull request may close this issue.

2 participants