Skip to content

Commit

Permalink
Ow revamp 2 (#432)
Browse files Browse the repository at this point in the history
* Updated the bidId to real-time generated one, which is used by Logger and Tracker

* Updating bidId for tracker and logger call

Co-authored-by: Azhar <azhar@L1119.local>
Co-authored-by: pm-azhar-mulla <75726247+pm-azhar-mulla@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 30, 2020
1 parent 5f98d27 commit c4f340d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
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

0 comments on commit c4f340d

Please sign in to comment.