Created
December 7, 2015 19:24
-
-
Save Ricardonacif/671d4b71ffe9af230d1a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// add a listener and create an array called DataLayerResults | |
var DataLayerResults = []; | |
(function() { | |
console.log("Listening for data layer events"); | |
WSI.dataLayer.registerCallback(function(a, b, c) { | |
var new_event = {}; | |
console.group("Event:" + b.name || ''); | |
new_event.event_name = b.name || ''; | |
console.log("Original:", a); | |
new_event.original = a; | |
console.log("Event:", JSON.stringify(b, null, 2)); | |
new_event.event = JSON.stringify(b, null, 2); | |
console.log("Updated:", c); | |
new_event.updated = c; | |
DataLayerResults.push(new_event); | |
console.groupEnd(); | |
}) | |
})(); |
This file contains hidden or 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
//reads the array | |
var DataLayerResults = []; | |
(function() { | |
return DataLayerResults; | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment