Skip to content

Commit

Permalink
PubmaticAnalyticsAdapter: add prebid version in logger call (#10531)
Browse files Browse the repository at this point in the history
* 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 Sep 27, 2023
1 parent e0f80a4 commit e4c1349
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions modules/pubmaticAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ function executeBidsLoggerCall(e, highestCpmBids) {
outputObj['pdvid'] = '' + profileVersionId;
outputObj['dvc'] = {'plt': getDevicePlatform()};
outputObj['tgid'] = getTgId();
outputObj['pbv'] = getGlobal()?.version || '-1';

if (floorData && fetchStatus) {
outputObj['fmv'] = floorData.floorRequestData ? floorData.floorRequestData.modelVersion || undefined : undefined;
Expand Down
12 changes: 9 additions & 3 deletions test/spec/modules/pubmaticAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import pubmaticAnalyticsAdapter, {getMetadata} from 'modules/pubmaticAnalyticsAdapter.js';
import adapterManager from 'src/adapterManager.js';
import CONSTANTS from 'src/constants.json';
import {config} from 'src/config.js';
import {setConfig} from 'modules/currency.js';
import {server} from '../../mocks/xhr.js';
import { config } from 'src/config.js';
import { setConfig } from 'modules/currency.js';
import { server } from '../../mocks/xhr.js';
import 'src/prebid.js';
import { getGlobal } from 'src/prebidGlobal';

let events = require('src/events');
let ajax = require('src/ajax');
Expand Down Expand Up @@ -367,6 +368,7 @@ describe('pubmatic analytics adapter', function () {
expect(data.tgid).to.equal(15);
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 @@ -574,6 +576,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.tgid).to.equal(0);
Expand Down Expand Up @@ -648,6 +651,7 @@ describe('pubmatic analytics adapter', function () {
expect(data.tgid).to.equal(0);// test group id should be between 0-15 else set to 0
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 @@ -1184,6 +1188,7 @@ describe('pubmatic analytics adapter', function () {
expect(data.tst).to.equal(1519767016);
expect(data.tgid).to.equal(15);
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 @@ -1305,6 +1310,7 @@ describe('pubmatic analytics adapter', function () {
expect(data.tst).to.equal(1519767016);
expect(data.tgid).to.equal(15);
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 e4c1349

Please sign in to comment.