Skip to content

Commit

Permalink
Pubxai Bid Adapter: added extra field to the winning bid object. (#8095)
Browse files Browse the repository at this point in the history
* Added extra field to the winning bid object.

* Lint isuues fixes

Co-authored-by: Phaneendra Hegde <phaneendra.hegde@gmail.com>
  • Loading branch information
pnh-pubx and pnhegde authored Feb 22, 2022
1 parent a2e7a57 commit e5d1f8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
13 changes: 7 additions & 6 deletions modules/pubxaiAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,14 @@ function send(data, status) {
let location = getWindowLocation();
const storage = getStorage();
data.initOptions = initOptions;
data.pageDetail = {};
Object.assign(data.pageDetail, {
host: location.host,
path: location.pathname,
search: location.search
});
if (typeof data !== 'undefined' && typeof data.auctionInit !== 'undefined') {
Object.assign(data.pageDetail, {
host: location.host,
path: location.pathname,
search: location.search,
adUnitCount: data.auctionInit.adUnitCodes ? data.auctionInit.adUnitCodes.length : null
});
data.pageDetail.adUnitCount = data.auctionInit.adUnitCodes ? data.auctionInit.adUnitCodes.length : null;
data.initOptions.auctionId = data.auctionInit.auctionId;
delete data.auctionInit;

Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/pubxaiAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,11 @@ describe('pubxai analytics adapter', function() {
'statusMessage': 'Bid available',
'timeToRespond': 267
},
'pageDetail': {
'host': location.host,
'path': location.pathname,
'search': location.search
},
'deviceDetail': {
'platform': navigator.platform,
'deviceType': getDeviceType(),
Expand Down

0 comments on commit e5d1f8f

Please sign in to comment.