Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Livewrapped adapter: Collect meta data and deal ids #8176

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions modules/livewrappedAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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
});
}
});
Expand Down Expand Up @@ -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
});
}
});
Expand Down
29 changes: 25 additions & 4 deletions test/spec/modules/livewrappedAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -54,6 +58,10 @@ const BID2 = Object.assign({}, BID1, {
bidId: '3ecff0db240757',
requestId: '3ecff0db240757',
adId: '3ecff0db240757',
meta: {
data: 'value2'
},
dealId: undefined
});

const BID3 = {
Expand Down Expand Up @@ -190,7 +198,10 @@ const ANALYTICS_MESSAGE = {
IsBid: true,
mediaType: 1,
gdpr: 0,
auctionId: 0
auctionId: 0,
meta: {
data: 'value1'
}
},
{
timeStamp: 1519149562216,
Expand All @@ -205,7 +216,10 @@ const ANALYTICS_MESSAGE = {
IsBid: true,
mediaType: 1,
gdpr: 0,
auctionId: 0
auctionId: 0,
meta: {
data: 'value2'
}
},
{
timeStamp: 1519149562216,
Expand All @@ -231,7 +245,11 @@ const ANALYTICS_MESSAGE = {
orgCpm: 120,
mediaType: 1,
gdpr: 0,
auctionId: 0
auctionId: 0,
meta: {
data: 'value1'
},
dealId: 'dealid'
},
{
timeStamp: 1519149562216,
Expand All @@ -244,7 +262,10 @@ const ANALYTICS_MESSAGE = {
orgCpm: 230,
mediaType: 1,
gdpr: 0,
auctionId: 0
auctionId: 0,
meta: {
data: 'value2'
}
}
],
rf: [
Expand Down