Skip to content

Commit

Permalink
Yieldone Analytics Adapter: Fix empty events (#5617)
Browse files Browse the repository at this point in the history
* Added Y1 Analytics Adapter

* rename y1AnalyticsAdapter in yieldoneAnalyticsAdapter

* Yieldone Bid Adapter: fixes from lint check

* Yieldone Analytics Adapter: fix endpoint protocol

* Added spec file for yieldone Analytics Adapter

* Add adUnitName to analytics data for Yieldone Analytics Adapter

* Fix yieldone Analytics Adapter to log only id from adUnitPath

* Fix bug with timeout event in Yieldone Analytics Adapter

* Update yieldone analytics adapter to remove excess 'ad' field from data

* Update yieldone analytics adapter

* Yieldone Analytics Adapter: remove dispensable events from log

* Platform One Analytics Adapter: fixes after review

* Fix empty events in Yieldone Analytics Adapter
  • Loading branch information
hbanalytics authored Aug 18, 2020
1 parent f983af2 commit cc58b23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/yieldoneAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const yieldoneAnalytics = Object.assign(adapter({analyticsType}), {
auctionManager.getAdUnitCodes(),
auctionManager.getBidsReceived()
);
if (yieldoneAnalytics.eventsStorage[currentAuctionId]) {
if (yieldoneAnalytics.eventsStorage[currentAuctionId] && yieldoneAnalytics.eventsStorage[currentAuctionId].events.length) {
yieldoneAnalytics.eventsStorage[currentAuctionId].page = {url: referrers[currentAuctionId]};
yieldoneAnalytics.eventsStorage[currentAuctionId].pubId = pubId;
yieldoneAnalytics.eventsStorage[currentAuctionId].wrapper_version = '$prebid.version$';
Expand All @@ -139,16 +139,16 @@ const yieldoneAnalytics = Object.assign(adapter({analyticsType}), {
}
}
},
sendStat(events, auctionId) {
if (!events) return;
sendStat(data, auctionId) {
if (!data || !data.events || !data.events.length) return;
delete yieldoneAnalytics.eventsStorage[auctionId];
ajax(
url,
{
success: function() {},
error: function() {}
},
JSON.stringify(events),
JSON.stringify(data),
{
method: 'POST'
}
Expand Down

0 comments on commit cc58b23

Please sign in to comment.