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

[UOE-5870] Behaviour discrepancy of slotid/bidid used in dfp call and logger & tracker calls #431

Merged
merged 3 commits into from
Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions modules/pubmaticAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ function executeBidsLoggerCall(e, highestCpmBids) {

function executeBidWonLoggerCall(auctionId, adUnitId) {
const winningBidId = cache.auctions[auctionId].adUnitCodes[adUnitId].bidWon;
const winningBid = cache.auctions[auctionId].adUnitCodes[adUnitId].bids[winningBidId];
const requestId = cache.auctions[auctionId].adUnitCodes[adUnitId].requestId;
const winningBid = cache.auctions[auctionId].adUnitCodes[adUnitId].bids[requestId];
let pixelURL = END_POINT_WIN_BID_LOGGER;
pixelURL += 'pubid=' + publisherId;
pixelURL += '&purl=' + enc(config.getConfig('pageUrl') || cache.auctions[auctionId].referer || '');
Expand Down Expand Up @@ -372,8 +373,10 @@ function bidderDoneHandler(args) {
}

function bidWonHandler(args) {
let auctionCache = cache.auctions[args.auctionId];
auctionCache.adUnitCodes[args.adUnitCode].bidWon = args.requestId;
let adUnitCache = cache.auctions[args.auctionId].adUnitCodes[args.adUnitCode];
adUnitCache.bidWon = args.adId;
adUnitCache.requestId = args.requestId;
adUnitCache.bids[args.requestId].bidId = args.adId;
executeBidWonLoggerCall(args.auctionId, args.adUnitCode);
}

Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/pubmaticAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const BID = {
'statusMessage': 'Bid available',
'bidId': '2ecff0db240757',
'partnerImpId': 'partnerImpressionID-1',
'adId': 'fake_ad_id',
'adId': '2ecff0db240757',
'source': 's2s',
'requestId': '2ecff0db240757',
'currency': 'USD',
Expand Down Expand Up @@ -77,7 +77,7 @@ const BID2 = Object.assign({}, BID, {
adUnitCode: '/19968336/header-bid-tag-1',
bidId: '3bd4ebb1c900e2',
partnerImpId: 'partnerImpressionID-2',
adId: 'fake_ad_id_2',
adId: '3bd4ebb1c900e2',
requestId: '3bd4ebb1c900e2',
width: 728,
height: 90,
Expand Down