Skip to content

Commit

Permalink
PubMatic: sending transactionId in source.tid (prebid#4588)
Browse files Browse the repository at this point in the history
* added support for pubcommon, digitrust, id5id

* added support for IdentityLink

* changed the source for id5

* added unit test cases

* changed source param for identityLink

* using utils.deepSetvalue

* passing transactionId in source.tid
  • Loading branch information
pm-harshad-mane authored and sa1omon committed Dec 19, 2019
1 parent 3e9daae commit 3c961f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
20 changes: 6 additions & 14 deletions modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -895,31 +895,23 @@ export const spec = {
payload.site.page = conf.kadpageurl.trim() || payload.site.page.trim();
payload.site.domain = _getDomainFromURL(payload.site.page);

// passing transactionId in source.tid
utils.deepSetValue(payload, 'source.tid', conf.transactionId);

// test bids
if (window.location.href.indexOf('pubmaticTest=true') !== -1) {
payload.test = 1;
}

// adding schain object
if (validBidRequests[0].schain) {
payload.source = {
ext: {
schain: validBidRequests[0].schain
}
};
utils.deepSetValue(payload, 'source.ext.schain', validBidRequests[0].schain);
}

// Attaching GDPR Consent Params
if (bidderRequest && bidderRequest.gdprConsent) {
payload.user.ext = {
consent: bidderRequest.gdprConsent.consentString
};

payload.regs = {
ext: {
gdpr: (bidderRequest.gdprConsent.gdprApplies ? 1 : 0)
}
};
utils.deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString);
utils.deepSetValue(payload, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0));
}

// CCPA
Expand Down
1 change: 1 addition & 0 deletions test/spec/modules/pubmaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ describe('PubMatic adapter', function () {
expect(data.user.geo.lon).to.equal(parseFloat(bidRequests[0].params.lon)); // Lognitude
expect(data.ext.wrapper.wv).to.equal($$REPO_AND_VERSION$$); // Wrapper Version
expect(data.ext.wrapper.transactionId).to.equal(bidRequests[0].transactionId); // Prebid TransactionId
expect(data.source.tid).to.equal(bidRequests[0].transactionId); // Prebid TransactionId
expect(data.ext.wrapper.wiid).to.equal(bidRequests[0].params.wiid); // OpenWrap: Wrapper Impression ID
expect(data.ext.wrapper.profile).to.equal(parseInt(bidRequests[0].params.profId)); // OpenWrap: Wrapper Profile ID
expect(data.ext.wrapper.version).to.equal(parseInt(bidRequests[0].params.verId)); // OpenWrap: Wrapper Profile Version ID
Expand Down

0 comments on commit 3c961f2

Please sign in to comment.