Skip to content

Commit

Permalink
PubxaiAnalyticsAdapter: Added extra fields to winning bid object (#8644)
Browse files Browse the repository at this point in the history
* Added extra fields to winning bid object

* Update: Picking specific fields from floorDetail instead of including the entire object

Co-authored-by: Phaneendra Hegde <[email protected]>
  • Loading branch information
pnhegde and pnhegde authored Jul 12, 2022
1 parent cdbc08a commit c09108b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/pubxaiAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ function mapBidResponse(bidResponse, status) {
} else {
Object.assign(bid, {
bidId: bidResponse.requestId,
floorProvider: events.floorDetail ? events.floorDetail.floorProvider : null,
floorProvider: events.floorDetail?.floorProvider || null,
floorFetchStatus: events.floorDetail?.fetchStatus || null,
floorLocation: events.floorDetail?.location || null,
floorModelVersion: events.floorDetail?.modelVersion || null,
floorSkipRate: events.floorDetail?.skipRate || 0,
isFloorSkipped: events.floorDetail?.skipped || false,
isWinningBid: true,
placementId: bidResponse.params ? deepAccess(bidResponse, 'params.0.placementId') : null,
renderedSize: bidResponse.size,
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 @@ -624,6 +624,11 @@ describe('pubxai analytics adapter', function() {
}
},
'floorProvider': 'PubXFloorProvider',
'floorFetchStatus': 'success',
'floorLocation': 'fetch',
'floorModelVersion': 'test model 1.0',
'floorSkipRate': 0,
'isFloorSkipped': false,
'isWinningBid': true,
'mediaType': 'banner',
'netRevenue': true,
Expand Down

0 comments on commit c09108b

Please sign in to comment.