Skip to content

Commit

Permalink
feat(analytics): retrieve cpm and currency from bids (#11774)
Browse files Browse the repository at this point in the history
  • Loading branch information
maelmrgt committed Jun 12, 2024
1 parent 236a8ad commit 69d7906
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion modules/greenbidsAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {deepClone, generateUUID, logError, logInfo, logWarn, getParameterByName}

const analyticsType = 'endpoint';

export const ANALYTICS_VERSION = '2.2.1';
export const ANALYTICS_VERSION = '2.3.0';

const ANALYTICS_SERVER = 'https://a.greenbids.ai';

Expand Down Expand Up @@ -135,6 +135,8 @@ export const greenbidsAnalyticsAdapter = Object.assign(adapter({ANALYTICS_SERVER
} else {
if (status === BIDDER_STATUS.BID) {
message.adUnits[adUnitIndex].bidders[bidderIndex].hasBid = true;
message.adUnits[adUnitIndex].bidders[bidderIndex].cpm = bid.cpm;
message.adUnits[adUnitIndex].bidders[bidderIndex].currency = bid.currency;
} else if (status === BIDDER_STATUS.TIMEOUT) {
message.adUnits[adUnitIndex].bidders[bidderIndex].isTimeout = true;
}
Expand Down
8 changes: 5 additions & 3 deletions test/spec/modules/greenbidsAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,12 @@ describe('Greenbids Prebid AnalyticsAdapter Testing', function () {
{
bidder: 'greenbids',
isTimeout: false,
hasBid: true
hasBid: true,
},
{
bidder: 'greenbidsx',
isTimeout: false,
hasBid: true
hasBid: true,
}
]
},
Expand Down Expand Up @@ -312,7 +312,9 @@ describe('Greenbids Prebid AnalyticsAdapter Testing', function () {
{
bidder: 'greenbids',
isTimeout: true,
hasBid: true
hasBid: true,
cpm: 0.09,
currency: 'USD',
}
]
}
Expand Down

0 comments on commit 69d7906

Please sign in to comment.