Skip to content

Commit

Permalink
Livewrapper Analytics Adapter: prioritize reporting Livewrapped floor…
Browse files Browse the repository at this point in the history
… data (#7554)

* Livewrapped bid and analytics adapter

* Fixed some tests for browser compatibility

* Fixed some tests for browser compatibility

* Changed analytics adapter code name

* Fix double quote in debug message

* modified how gdpr is being passed

* Added support for Publisher Common ID Module

* Corrections for ttr in analytics

* ANalytics updates

* Auction start time stamp changed

* Detect recovered ad blocked requests
Make it possible to pass dynamic parameters to adapter

* Collect info on ad units receiving any valid bid

* Support for ID5
Pass metadata from adapter

* Typo in test + eids on wrong level

* Fix for Prebid 3.0

* Fix get referer

* http -> https in tests

* Native support

* Read sizes from mediatype.banner

* Revert accidental commit

* Support native data collection + minor refactorings

* Set analytics endpoint

* Support for app parameters

* Fix issue where adunits with bids were not counted on reload

* Send debug info from adapter to external debugger

* SChain support

* Send GDPR data in analytics request

* video support

Video support

* Report back floor via analytic

* Send auction id and adunit/bidder connection id

* Criteo id support

* Updated example

* livewrapped Analytics Adapter info file

* Livewrapped gvlid

* Pass parameter from wrapper

* Read data-adunitid attribute on ad container if it exists and pass to analytics endpoint

* Fix null check

* Prioritize Livewrapped floors information over floor price module floor information
  • Loading branch information
bjorn-lw authored Oct 12, 2021
1 parent e60d065 commit 60672a5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
6 changes: 4 additions & 2 deletions modules/livewrappedAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE
bidResponse.ttr = args.timeToRespond;
bidResponse.readyToSend = 1;
bidResponse.mediaType = args.mediaType == 'native' ? 2 : (args.mediaType == 'video' ? 4 : 1);
bidResponse.floorData = args.floorData;
if (!bidResponse.ttr) {
bidResponse.ttr = time - bidResponse.start;
}
Expand Down Expand Up @@ -108,6 +109,7 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE
logInfo('LIVEWRAPPED_BID_WON:', args);
let wonBid = cache.auctions[args.auctionId].bids[args.requestId];
wonBid.won = true;
wonBid.floorData = args.floorData;
if (wonBid.sendStatus != 0) {
livewrappedAnalyticsAdapter.sendEvents();
}
Expand Down Expand Up @@ -226,7 +228,7 @@ function getResponses(gdpr, auctionIds) {
IsBid: bid.isBid,
mediaType: bid.mediaType,
gdpr: gdprPos,
floor: bid.floorData ? bid.floorData.floorValue : bid.lwFloor,
floor: bid.lwFloor ? bid.lwFloor : (bid.floorData ? bid.floorData.floorValue : undefined),
floorCur: bid.floorData ? bid.floorData.floorCurrency : undefined,
auctionId: auctionIdPos,
auc: bid.auc,
Expand Down Expand Up @@ -263,7 +265,7 @@ function getWins(gdpr, auctionIds) {
cpm: bid.cpm,
mediaType: bid.mediaType,
gdpr: gdprPos,
floor: bid.floorData ? bid.floorData.floorValue : bid.lwFloor,
floor: bid.lwFloor ? bid.lwFloor : (bid.floorData ? bid.floorData.floorValue : undefined),
floorCur: bid.floorData ? bid.floorData.floorCurrency : undefined,
auctionId: auctionIdPos,
auc: bid.auc,
Expand Down
24 changes: 17 additions & 7 deletions test/spec/modules/livewrappedAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,18 +416,28 @@ describe('Livewrapped analytics adapter', function () {
{
'bidder': 'livewrapped',
'adUnitCode': 'panorama_d_1',
'bidId': '2ecff0db240757',
'floorData': {
'floorValue': 1.1,
'floorCurrency': 'SEK'
}
'bidId': '2ecff0db240757'
}
],
'start': 1519149562216
});

events.emit(BID_RESPONSE, MOCK.BID_RESPONSE[0]);
events.emit(BID_WON, MOCK.BID_WON[0]);
events.emit(BID_RESPONSE, Object.assign({},
MOCK.BID_RESPONSE[0],
{
'floorData': {
'floorValue': 1.1,
'floorCurrency': 'SEK'
}
}));
events.emit(BID_WON, Object.assign({},
MOCK.BID_WON[0],
{
'floorData': {
'floorValue': 1.1,
'floorCurrency': 'SEK'
}
}));
events.emit(AUCTION_END, MOCK.AUCTION_END);

clock.tick(BID_WON_TIMEOUT + 1000);
Expand Down

0 comments on commit 60672a5

Please sign in to comment.