Skip to content

Commit

Permalink
PubMatic analytics adapter: Not passing GDPR information (#5791)
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

* not passing GDPR data in analytics
  • Loading branch information
pm-harshad-mane authored Sep 28, 2020
1 parent c696e00 commit a054aa0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
8 changes: 0 additions & 8 deletions modules/pubmaticAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,6 @@ function executeBidsLoggerCall(e, highestCpmBids) {
return 0;
})();

// GDPR support
if (auctionCache.gdprConsent) {
outputObj['cns'] = auctionCache.gdprConsent.consentString || '';
outputObj['gdpr'] = auctionCache.gdprConsent.gdprApplies === true ? 1 : 0;
pixelURL += '&gdEn=1';
}

outputObj.s = Object.keys(auctionCache.adUnitCodes).reduce(function(slotsArray, adUnitId) {
let adUnit = auctionCache.adUnitCodes[adUnitId];
let slotObject = {
Expand Down Expand Up @@ -307,7 +300,6 @@ function auctionInitHandler(args) {
}

function bidRequestedHandler(args) {
cache.auctions[args.auctionId].gdprConsent = args.gdprConsent || undefined;
args.bids.forEach(function(bid) {
if (!cache.auctions[args.auctionId].adUnitCodes.hasOwnProperty(bid.adUnitCode)) {
cache.auctions[args.auctionId].adUnitCodes[bid.adUnitCode] = {
Expand Down
10 changes: 4 additions & 6 deletions test/spec/modules/pubmaticAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ describe('pubmatic analytics adapter', function () {
clock.tick(2000 + 1000);
expect(requests.length).to.equal(3); // 1 logger and 2 win-tracker
let request = requests[2]; // logger is executed late, trackers execute first
expect(request.url).to.equal('https://t.pubmatic.com/wl?pubid=9999&gdEn=1');
expect(request.url).to.equal('https://t.pubmatic.com/wl?pubid=9999');
let data = getLoggerJsonFromRequest(request.requestBody);
expect(data.pubid).to.equal('9999');
expect(data.pid).to.equal('1111');
Expand All @@ -326,8 +326,6 @@ describe('pubmatic analytics adapter', function () {
expect(data.purl).to.equal('http://www.test.com/page.html');
expect(data.orig).to.equal('www.test.com');
expect(data.tst).to.equal(1519767016);
expect(data.cns).to.equal('here-goes-gdpr-consent-string');
expect(data.gdpr).to.equal(1);
expect(data.tgid).to.equal(15);
expect(data.s).to.be.an('array');
expect(data.s.length).to.equal(2);
Expand Down Expand Up @@ -423,7 +421,7 @@ describe('pubmatic analytics adapter', function () {
clock.tick(2000 + 1000);
expect(requests.length).to.equal(3); // 1 logger and 2 win-tracker
let request = requests[2]; // logger is executed late, trackers execute first
expect(request.url).to.equal('https://t.pubmatic.com/wl?pubid=9999&gdEn=1');
expect(request.url).to.equal('https://t.pubmatic.com/wl?pubid=9999');
let data = getLoggerJsonFromRequest(request.requestBody);
expect(data.pubid).to.equal('9999');
expect(data.pid).to.equal('1111');
Expand Down Expand Up @@ -490,7 +488,7 @@ describe('pubmatic analytics adapter', function () {
clock.tick(2000 + 1000);
expect(requests.length).to.equal(3); // 1 logger and 2 win-tracker
let request = requests[2]; // logger is executed late, trackers execute first
expect(request.url).to.equal('https://t.pubmatic.com/wl?pubid=9999&gdEn=1');
expect(request.url).to.equal('https://t.pubmatic.com/wl?pubid=9999');
let data = getLoggerJsonFromRequest(request.requestBody);
expect(data.pubid).to.equal('9999');
expect(data.pid).to.equal('1111');
Expand Down Expand Up @@ -672,7 +670,7 @@ describe('pubmatic analytics adapter', function () {
clock.tick(2000 + 1000);
expect(requests.length).to.equal(3); // 1 logger and 2 win-tracker
let request = requests[2]; // logger is executed late, trackers execute first
expect(request.url).to.equal('https://t.pubmatic.com/wl?pubid=9999&gdEn=1');
expect(request.url).to.equal('https://t.pubmatic.com/wl?pubid=9999');
let data = getLoggerJsonFromRequest(request.requestBody);
expect(data.s[1].sn).to.equal('/19968336/header-bid-tag-1');
expect(data.s[1].sz).to.deep.equal(['1000x300', '970x250', '728x90']);
Expand Down

0 comments on commit a054aa0

Please sign in to comment.