Skip to content

Commit

Permalink
PubmaticAnalyticsAdapter: add prebid version in logger call (prebid#1…
Browse files Browse the repository at this point in the history
…0531)

* Sending prebid version in logger call

* Test cases

* Kick off integration test and styles

---------

Co-authored-by: Chris Huie <[email protected]>
  • Loading branch information
pm-priyanka-deshmane and ChrisHuie committed Oct 4, 2023
1 parent 334d538 commit cdd5b66
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 @@ -486,6 +486,7 @@ function executeBidsLoggerCall(e, highestCpmBids) {
outputObj['tis'] = frequencyDepth?.impressionServed;
outputObj['lip'] = frequencyDepth?.lip;
outputObj['tgid'] = getTgId();
outputObj['pbv'] = getGlobal()?.version || '-1';

if (floorData && floorFetchStatus) {
outputObj['fmv'] = floorData.floorRequestData ? floorData.floorRequestData.modelVersion || undefined : undefined;
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 @@ -7,6 +7,7 @@ import {
addBidResponseHook,
} from 'modules/currency.js';
import { getGlobal } from '../../../src/prebidGlobal';
import 'src/prebid.js';

let events = require('src/events');
let ajax = require('src/ajax');
Expand Down Expand Up @@ -417,6 +418,7 @@ describe('pubmatic analytics adapter', function () {
expect(data.it).to.equal('hybrid');
expect(data.fmv).to.equal('floorModelTest');
expect(data.ft).to.equal(1);
expect(data.pbv).to.equal(getGlobal()?.version || '-1');
expect(data.s).to.be.an('array');
expect(data.s.length).to.equal(2);
expect(data.owv).to.equal(window?.PWT?.versionDetails?.openwrap_version || '-1');
Expand Down Expand Up @@ -648,6 +650,7 @@ describe('pubmatic analytics adapter', function () {
expect(data.pid).to.equal('1111');
expect(data.fmv).to.equal('floorModelTest');
expect(data.ft).to.equal(1);
expect(data.pbv).to.equal(getGlobal()?.version || '-1');
expect(data.s).to.be.an('array');
expect(data.s.length).to.equal(2);
expect(data.bm).not.to.be.null;
Expand Down Expand Up @@ -735,6 +738,7 @@ describe('pubmatic analytics adapter', function () {
expect(data.it).to.equal('hybrid');
expect(data.fmv).to.equal('floorModelTest');
expect(data.ft).to.equal(1);
expect(data.pbv).to.equal(getGlobal()?.version || '-1');
expect(data.s).to.be.an('array');
expect(data.s.length).to.equal(2);
// slot 1
Expand Down Expand Up @@ -1272,6 +1276,7 @@ describe('pubmatic analytics adapter', function () {
expect(data.tgid).to.equal(15);
expect(data.it).to.equal('hybrid');
expect(data.fmv).to.equal('floorModelTest');
expect(data.pbv).to.equal(getGlobal()?.version || '-1');
expect(data.ft).to.equal(1);
expect(data.s).to.be.an('array');
expect(data.s.length).to.equal(2);
Expand Down Expand Up @@ -1412,6 +1417,7 @@ describe('pubmatic analytics adapter', function () {
expect(data.tgid).to.equal(15);
expect(data.it).to.equal('hybrid');
expect(data.fmv).to.equal('floorModelTest');
expect(data.pbv).to.equal(getGlobal()?.version || '-1');
expect(data.ft).to.equal(1);
expect(data.s).to.be.an('array');
expect(data.s.length).to.equal(2);
Expand Down

0 comments on commit cdd5b66

Please sign in to comment.