Created
December 3, 2019 07:03
-
-
Save Danny-Driscoll/969bc9f193c0f4f3c891b374bc2f734b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var impression_count = 0; | |
var count_impressions = function(logEvent){ | |
var visitors = logEvent.params.visitors; | |
visitors.forEach(function(visitor){ | |
console.log(visitor) | |
var snapshots = visitor.snapshots; | |
snapshots.forEach(function(snapshot){ | |
var events = snapshot.events | |
events.forEach(function(event){ | |
if(event.key == "campaign_activated"){ | |
console.log(event.entity_id); | |
impression_count++ | |
console.log(impression_count); | |
} | |
}) | |
}); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment