diff --git a/modules/livewrappedAnalyticsAdapter.js b/modules/livewrappedAnalyticsAdapter.js index 25b919956e0..1116fd99ba0 100644 --- a/modules/livewrappedAnalyticsAdapter.js +++ b/modules/livewrappedAnalyticsAdapter.js @@ -86,6 +86,8 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE bidResponse.readyToSend = 1; bidResponse.mediaType = args.mediaType == 'native' ? 2 : (args.mediaType == 'video' ? 4 : 1); bidResponse.floorData = args.floorData; + bidResponse.meta = args.meta; + if (!bidResponse.ttr) { bidResponse.ttr = time - bidResponse.start; } @@ -115,6 +117,8 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE wonBid.won = true; wonBid.floorData = args.floorData; wonBid.rUp = args.rUp; + wonBid.meta = args.meta; + wonBid.dealId = args.dealId; if (wonBid.sendStatus != 0) { livewrappedAnalyticsAdapter.sendEvents(); } @@ -251,7 +255,8 @@ function getResponses(gdpr, auctionIds) { auctionId: auctionIdPos, auc: bid.auc, buc: bid.buc, - lw: bid.lw + lw: bid.lw, + meta: bid.meta }); } }); @@ -290,7 +295,9 @@ function getWins(gdpr, auctionIds) { auc: bid.auc, buc: bid.buc, lw: bid.lw, - rUp: bid.rUp + rUp: bid.rUp, + meta: bid.meta, + dealId: bid.dealId }); } }); diff --git a/test/spec/modules/livewrappedAnalyticsAdapter_spec.js b/test/spec/modules/livewrappedAnalyticsAdapter_spec.js index bd6f361572b..bab7a68287d 100644 --- a/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +++ b/test/spec/modules/livewrappedAnalyticsAdapter_spec.js @@ -38,6 +38,10 @@ const BID1 = { adId: '2ecff0db240757', auctionId: '25c6d7f5-699a-4bfc-87c9-996f915341fa', mediaType: 'banner', + meta: { + data: 'value1' + }, + dealId: 'dealid', getStatusCode() { return CONSTANTS.STATUS.GOOD; } @@ -54,6 +58,10 @@ const BID2 = Object.assign({}, BID1, { bidId: '3ecff0db240757', requestId: '3ecff0db240757', adId: '3ecff0db240757', + meta: { + data: 'value2' + }, + dealId: undefined }); const BID3 = { @@ -190,7 +198,10 @@ const ANALYTICS_MESSAGE = { IsBid: true, mediaType: 1, gdpr: 0, - auctionId: 0 + auctionId: 0, + meta: { + data: 'value1' + } }, { timeStamp: 1519149562216, @@ -205,7 +216,10 @@ const ANALYTICS_MESSAGE = { IsBid: true, mediaType: 1, gdpr: 0, - auctionId: 0 + auctionId: 0, + meta: { + data: 'value2' + } }, { timeStamp: 1519149562216, @@ -231,7 +245,11 @@ const ANALYTICS_MESSAGE = { orgCpm: 120, mediaType: 1, gdpr: 0, - auctionId: 0 + auctionId: 0, + meta: { + data: 'value1' + }, + dealId: 'dealid' }, { timeStamp: 1519149562216, @@ -244,7 +262,10 @@ const ANALYTICS_MESSAGE = { orgCpm: 230, mediaType: 1, gdpr: 0, - auctionId: 0 + auctionId: 0, + meta: { + data: 'value2' + } } ], rf: [