Skip to content

Commit

Permalink
Get floor from correct places on bid object & replace div ID with size (
Browse files Browse the repository at this point in the history
prebid#8093)

Co-authored-by: Rachel Joyce <rachelrj@umich.edy>
  • Loading branch information
Rachel Joyce and Rachel Joyce authored Mar 1, 2022
1 parent 72022b7 commit 69de981
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions modules/googleAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,13 @@ function sendBidRequestToGa(bid) {
_analyticsQueue.push(function () {
_eventCount++;
if (_sendFloors) {
var floor = (bid.floorMin) ? bid.floorMin : 'No Floor';
window[_gaGlobal](_trackerSend, 'event', _category, 'Requests by Floor=' + floor, 'Ad Unit=' + bid.adUnitCode + ',' + bid.bidderCode, 1, _disableInteraction);
var floor = 'No Floor';
if (bid.floorData) {
floor = bid.floorData.floorValue;
} else if (bid.bids.length) {
floor = bid.bids[0].getFloor().floor;
}
window[_gaGlobal](_trackerSend, 'event', _category, 'Requests by Floor=' + floor, bid.bidderCode, 1, _disableInteraction);
} else {
window[_gaGlobal](_trackerSend, 'event', _category, 'Requests', bid.bidderCode, 1, _disableInteraction);
}
Expand Down Expand Up @@ -239,8 +244,8 @@ function sendBidResponseToGa(bid) {
window[_gaGlobal](_trackerSend, 'event', 'Prebid.js CPM Distribution', cpmDis, bidder, 1, _disableInteraction);
}
if (_sendFloors) {
var floor = (bid.floorMin) ? bid.floorMin : 'No Floor';
window[_gaGlobal](_trackerSend, 'event', _category, 'Bids by Floor=' + floor, 'Ad Unit=' + bid.adUnitCode + ',' + bidder, cpmCents, _disableInteraction);
var floor = (bid.floorData) ? bid.floorData.floorValue : 'No Floor';
window[_gaGlobal](_trackerSend, 'event', _category, 'Bids by Floor=' + floor, 'Size=' + bid.size + ',' + bidder, cpmCents, _disableInteraction);
} else {
window[_gaGlobal](_trackerSend, 'event', _category, 'Bids', bidder, cpmCents, _disableInteraction);
}
Expand Down Expand Up @@ -270,8 +275,8 @@ function sendBidWonToGa(bid) {
_analyticsQueue.push(function () {
_eventCount++;
if (_sendFloors) {
var floor = (bid.floorMin) ? bid.floorMin : 'No Floor';
window[_gaGlobal](_trackerSend, 'event', _category, 'Wins by Floor=' + floor, 'Ad Unit=' + bid.adUnitCode + ',' + bid.bidderCode, cpmCents, _disableInteraction);
var floor = (bid.floorData) ? bid.floorData.floorValue : 'No Floor';
window[_gaGlobal](_trackerSend, 'event', _category, 'Wins by Floor=' + floor, 'Size=' + bid.size + ',' + bid.bidderCode, cpmCents, _disableInteraction);
} else {
window[_gaGlobal](_trackerSend, 'event', _category, 'Wins', bid.bidderCode, cpmCents, _disableInteraction);
}
Expand Down

0 comments on commit 69de981

Please sign in to comment.