From a74635880c5bf956fb55e3c686ba6a09b5f27c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Andersson?= Date: Fri, 18 Feb 2022 21:44:27 +0100 Subject: [PATCH 1/2] Collect metadata --- modules/livewrappedAnalyticsAdapter.js | 9 +++++-- .../livewrappedAnalyticsAdapter_spec.js | 26 ++++++++++++++++--- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/modules/livewrappedAnalyticsAdapter.js b/modules/livewrappedAnalyticsAdapter.js index 25b919956e0..61382914957 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,7 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE wonBid.won = true; wonBid.floorData = args.floorData; wonBid.rUp = args.rUp; + wonBid.meta = args.meta; if (wonBid.sendStatus != 0) { livewrappedAnalyticsAdapter.sendEvents(); } @@ -251,7 +254,8 @@ function getResponses(gdpr, auctionIds) { auctionId: auctionIdPos, auc: bid.auc, buc: bid.buc, - lw: bid.lw + lw: bid.lw, + meta: bid.meta }); } }); @@ -290,7 +294,8 @@ function getWins(gdpr, auctionIds) { auc: bid.auc, buc: bid.buc, lw: bid.lw, - rUp: bid.rUp + rUp: bid.rUp, + meta: bid.meta }); } }); diff --git a/test/spec/modules/livewrappedAnalyticsAdapter_spec.js b/test/spec/modules/livewrappedAnalyticsAdapter_spec.js index bd6f361572b..82a88feb423 100644 --- a/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +++ b/test/spec/modules/livewrappedAnalyticsAdapter_spec.js @@ -38,6 +38,9 @@ const BID1 = { adId: '2ecff0db240757', auctionId: '25c6d7f5-699a-4bfc-87c9-996f915341fa', mediaType: 'banner', + meta: { + data: 'value1' + }, getStatusCode() { return CONSTANTS.STATUS.GOOD; } @@ -54,6 +57,9 @@ const BID2 = Object.assign({}, BID1, { bidId: '3ecff0db240757', requestId: '3ecff0db240757', adId: '3ecff0db240757', + meta: { + data: 'value2' + } }); const BID3 = { @@ -190,7 +196,10 @@ const ANALYTICS_MESSAGE = { IsBid: true, mediaType: 1, gdpr: 0, - auctionId: 0 + auctionId: 0, + meta: { + data: 'value1' + } }, { timeStamp: 1519149562216, @@ -205,7 +214,10 @@ const ANALYTICS_MESSAGE = { IsBid: true, mediaType: 1, gdpr: 0, - auctionId: 0 + auctionId: 0, + meta: { + data: 'value2' + } }, { timeStamp: 1519149562216, @@ -231,7 +243,10 @@ const ANALYTICS_MESSAGE = { orgCpm: 120, mediaType: 1, gdpr: 0, - auctionId: 0 + auctionId: 0, + meta: { + data: 'value1' + } }, { timeStamp: 1519149562216, @@ -244,7 +259,10 @@ const ANALYTICS_MESSAGE = { orgCpm: 230, mediaType: 1, gdpr: 0, - auctionId: 0 + auctionId: 0, + meta: { + data: 'value2' + } } ], rf: [ From d09a689c8c968f861bfd9a1e162a6c85450f6070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Sat, 26 Feb 2022 20:04:00 +0100 Subject: [PATCH 2/2] Collect Deal Id --- modules/livewrappedAnalyticsAdapter.js | 4 +++- test/spec/modules/livewrappedAnalyticsAdapter_spec.js | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/livewrappedAnalyticsAdapter.js b/modules/livewrappedAnalyticsAdapter.js index 61382914957..1116fd99ba0 100644 --- a/modules/livewrappedAnalyticsAdapter.js +++ b/modules/livewrappedAnalyticsAdapter.js @@ -118,6 +118,7 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE wonBid.floorData = args.floorData; wonBid.rUp = args.rUp; wonBid.meta = args.meta; + wonBid.dealId = args.dealId; if (wonBid.sendStatus != 0) { livewrappedAnalyticsAdapter.sendEvents(); } @@ -295,7 +296,8 @@ function getWins(gdpr, auctionIds) { buc: bid.buc, lw: bid.lw, rUp: bid.rUp, - meta: bid.meta + meta: bid.meta, + dealId: bid.dealId }); } }); diff --git a/test/spec/modules/livewrappedAnalyticsAdapter_spec.js b/test/spec/modules/livewrappedAnalyticsAdapter_spec.js index 82a88feb423..bab7a68287d 100644 --- a/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +++ b/test/spec/modules/livewrappedAnalyticsAdapter_spec.js @@ -41,6 +41,7 @@ const BID1 = { meta: { data: 'value1' }, + dealId: 'dealid', getStatusCode() { return CONSTANTS.STATUS.GOOD; } @@ -59,7 +60,8 @@ const BID2 = Object.assign({}, BID1, { adId: '3ecff0db240757', meta: { data: 'value2' - } + }, + dealId: undefined }); const BID3 = { @@ -246,7 +248,8 @@ const ANALYTICS_MESSAGE = { auctionId: 0, meta: { data: 'value1' - } + }, + dealId: 'dealid' }, { timeStamp: 1519149562216,