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

if seatBidId is on bidResponse, always use it #4732

Merged
merged 1 commit into from
Jan 15, 2020
Merged

Conversation

robertrmartinez
Copy link
Collaborator

Type of change

  • Bugfix -> Not really a "bug" just code cleanup

Description of change

For Rubicon analytics adapter if there is a seatBidId on the bidResponse object then we will be sure to use that as the bidId we send to the batched endpoint.

This is just removing a couple unnecessary checks and adding a test.

@@ -224,7 +224,6 @@ const MOCK = {
'transactionId': 'c116413c-9e3f-401a-bee1-d56aec29a1d4',
'sizes': [[1000, 300], [970, 250], [728, 90]],
'bidId': '3bd4ebb1c900e2',
'seatBidId': 'aaaa-bbbb-cccc-dddd',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the mock of the bidRequestObject, which would never have seatBidId in it since seatBidId is a bidResponse field.

So not realistic to have it here.

// RP server banner overwrites bidId with bid.seatBidId
if (utils.deepAccess(bid, 'bidResponse.seatBidId') && bid.bidder === 'rubicon' && bid.source === 'server' && ['video', 'banner'].some(i => utils.deepAccess(bid, 'bidResponse.mediaType') === i)) {
bid.seatBidId = bid.bidResponse.seatBidId;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The line bid.bidResponse = parseBidResponse(args, bid.bidResponse);

Adds seatBidId to the internal bidResponse in the analytics adapter. And if that is present, it overwrites the
internal bidRequest.bidId which is sent to Analytics.

This bid.seatBidId is not referenced or used anywhere else in the code.

So does not make sense to add it to this bid object.

@harpere harpere merged commit 99da41f into master Jan 15, 2020
audiencerun pushed a commit to audiencerun/Prebid.js that referenced this pull request Jan 20, 2020
hellsingblack pushed a commit to SublimeSkinz/Prebid.js that referenced this pull request Mar 5, 2020
@robertrmartinez robertrmartinez deleted the rubicon_analytics_fix branch September 21, 2020 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants