Skip to content

Commit

Permalink
PubMatic Analytics Adapter: Sending 'ds' in tracker (#12735)
Browse files Browse the repository at this point in the history
* added code for sending 'dspid' in tracker

* added unit test cases for dspid in tracker

* updated name from dspid to ds
  • Loading branch information
pm-asit-sahoo authored Feb 12, 2025
1 parent a0b4c45 commit 34f6070
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions modules/pubmaticAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,10 @@ function executeBidWonLoggerCall(auctionId, adUnitId) {
pixelURL += '&kgpv=' + enc(getValueForKgpv(winningBid, adUnitId));
pixelURL += '&origbidid=' + enc(winningBid?.bidResponse?.partnerImpId || winningBid?.bidResponse?.prebidBidId || winningBid.bidId);
pixelURL += '&di=' + enc(winningBid?.bidResponse?.dealId || OPEN_AUCTION_DEAL_ID);
const ds = winningBid.bidResponse?.meta ? getMetadata(winningBid.bidResponse.meta).ds : undefined;
if (ds) {
pixelURL += '&ds=' + enc(ds);
}
pg && (pixelURL += '&pb=' + enc(pg));

pixelURL += '&plt=' + enc(getDevicePlatform());
Expand Down
7 changes: 6 additions & 1 deletion test/spec/modules/pubmaticAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ const BID = {
'floorRuleValue': 1.1,
'floorValue': 1.1
},
'meta': {
'demandSource': 1208,
},
getStatusCode() {
return 1;
}
Expand Down Expand Up @@ -103,7 +106,8 @@ const BID2 = Object.assign({}, BID, {
'hb_source': 'server'
},
meta: {
advertiserDomains: ['example.com']
advertiserDomains: ['example.com'],
'demandSource': 1208,
}
});

Expand Down Expand Up @@ -664,6 +668,7 @@ describe('pubmatic analytics adapter', function () {
expect(data.ss).to.equal('1');
expect(data.fskp).to.equal('0');
expect(data.af).to.equal('video');
expect(data.ds).to.equal('1208');
});

it('Logger : do not log floor fields when prebids floor shows noData in location property', function() {
Expand Down

0 comments on commit 34f6070

Please sign in to comment.