Skip to content

Commit

Permalink
Passing browser maping value to logger call
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapil Tuptewar authored and pm-azhar-mulla committed Dec 27, 2022
1 parent 7c65030 commit e256eb7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/pubmaticAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ function executeBidsLoggerCall(e, highestCpmBids) {
outputObj['pdvid'] = '' + profileVersionId;
outputObj['psl'] = getPSL(auctionId);
outputObj['dvc'] = {'plt': getDevicePlatform()};
outputObj["bm"] = window.PWT && window.PWT.browserMapping;
outputObj['tgid'] = (function() {
var testGroupId = parseInt(config.getConfig('testGroupId') || 0);
if (testGroupId <= 15 && testGroupId >= 0) {
Expand Down
6 changes: 6 additions & 0 deletions test/spec/modules/pubmaticAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ 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.bm).not.to.be.null;
expect(data.tgid).to.equal(15);
expect(data.fmv).to.equal('floorModelTest');
expect(data.ft).to.equal(1);
Expand Down Expand Up @@ -522,6 +523,7 @@ describe('pubmatic analytics adapter', function () {
expect(data.ft).to.equal(1);
expect(data.s).to.be.an('array');
expect(data.s.length).to.equal(2);
expect(data.bm).not.to.be.null;
expect(data.tgid).to.equal(0);
// slot 1
expect(data.s[0].sn).to.equal('/19968336/header-bid-tag-0');
Expand Down Expand Up @@ -595,6 +597,7 @@ describe('pubmatic analytics adapter', function () {
let data = getLoggerJsonFromRequest(request.requestBody);
expect(data.pubid).to.equal('9999');
expect(data.pid).to.equal('1111');
expect(data.bm).not.to.be.null;
expect(data.tgid).to.equal(0);// test group id should be between 0-15 else set to 0
expect(data.s).to.be.an('array');
expect(data.s.length).to.equal(2);
Expand Down Expand Up @@ -645,6 +648,7 @@ describe('pubmatic analytics adapter', function () {
expect(requests.length).to.equal(2); // 1 logger and 1 win-tracker
let request = requests[1]; // logger is executed late, trackers execute first
let data = getLoggerJsonFromRequest(request.requestBody);
expect(data.bm).not.to.be.null;
expect(data.tgid).to.equal(0);// test group id should be an INT between 0-15 else set to 0
expect(data.s[1].sn).to.equal('/19968336/header-bid-tag-1');
expect(data.s[1].au).to.equal('/19968336/header-bid-tag-1');
Expand Down Expand Up @@ -1356,6 +1360,7 @@ 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.bm).not.to.be.null;
expect(data.tgid).to.equal(15);
expect(data.fmv).to.equal('floorModelTest');
expect(data.ft).to.equal(1);
Expand Down Expand Up @@ -1484,6 +1489,7 @@ 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.bm).not.to.be.null;
expect(data.tgid).to.equal(15);
expect(data.fmv).to.equal('floorModelTest');
expect(data.ft).to.equal(1);
Expand Down

0 comments on commit e256eb7

Please sign in to comment.