Skip to content

Commit

Permalink
Handled bidderCode while logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pm-azhar-mulla authored and pm-azhar-mulla committed Jun 14, 2024
1 parent 4709ce5 commit 9607cc2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions modules/pubmaticAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ function isOWPubmaticBid(adapterName) {
})
}

function gatherPartnerBidsForAdUnitForLogger(adUnit, adUnitId, highestBid) {
function gatherPartnerBidsForAdUnitForLogger(adUnit, adUnitId, highestBid, e) {
highestBid = (highestBid && highestBid.length > 0) ? highestBid[0] : null;
return Object.keys(adUnit.bids).reduce(function(partnerBids, bidId) {
adUnit.bids[bidId].forEach(function(bid) {
Expand All @@ -290,6 +290,16 @@ function gatherPartnerBidsForAdUnitForLogger(adUnit, adUnitId, highestBid) {
return;
}
const pg = window.parseFloat(Number(bid.bidResponse?.adserverTargeting?.hb_pb || bid.bidResponse?.adserverTargeting?.pwtpb).toFixed(BID_PRECISION));

const prebidBidsReceived = e?.bidsReceived;
if (isArray(prebidBidsReceived) && prebidBidsReceived.length > 0) {
prebidBidsReceived.forEach(function(iBid) {
if (iBid.adId === bid.adId) {
bid.bidderCode = iBid.bidderCode;
}
});
}

partnerBids.push({
'pn': adapterName,
'bc': bid.bidderCode || bid.bidder,
Expand Down Expand Up @@ -407,7 +417,7 @@ function executeBidsLoggerCall(e, highestCpmBids) {
'au': origAdUnit.owAdUnitId || getGptSlotInfoForAdUnitCode(adUnitId)?.gptSlot || adUnitId,
'mt': getAdUnitAdFormats(origAdUnit),
'sz': getSizesForAdUnit(adUnit, adUnitId),
'ps': gatherPartnerBidsForAdUnitForLogger(adUnit, adUnitId, highestCpmBids.filter(bid => bid.adUnitCode === adUnitId)),
'ps': gatherPartnerBidsForAdUnitForLogger(adUnit, adUnitId, highestCpmBids.filter(bid => bid.adUnitCode === adUnitId), e),
'fskp': floorData && floorFetchStatus ? (floorData.floorRequestData ? (floorData.floorRequestData.skipped == false ? 0 : 1) : undefined) : undefined,
'sid': generateUUID()
};
Expand Down

0 comments on commit 9607cc2

Please sign in to comment.