Skip to content

Commit

Permalink
Revert "Ow revamp 2 (#432)" (#433)
Browse files Browse the repository at this point in the history
This reverts commit c4f340d.
  • Loading branch information
pm-shashank-jain authored Dec 30, 2020
1 parent 06440b5 commit 95263d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions modules/pubmaticAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@ function executeBidsLoggerCall(e, highestCpmBids) {

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

function bidWonHandler(args) {
let adUnitCache = cache.auctions[args.auctionId].adUnitCodes[args.adUnitCode];
adUnitCache.bidWon = args.adId;
adUnitCache.requestId = args.requestId;
adUnitCache.bids[args.requestId].bidId = args.adId;
let auctionCache = cache.auctions[args.auctionId];
auctionCache.adUnitCodes[args.adUnitCode].bidWon = args.requestId;
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': '2ecff0db240757',
'adId': 'fake_ad_id',
'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: '3bd4ebb1c900e2',
adId: 'fake_ad_id_2',
requestId: '3bd4ebb1c900e2',
width: 728,
height: 90,
Expand Down

0 comments on commit 95263d9

Please sign in to comment.