Created
January 26, 2018 16:24
-
-
Save lennardtastic/b0beb0db58940cd9c427fbbf959a50fe 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
// Define or retrieve an object to hold the custom variables | |
var usblCustom = window.usblCustom || {}; | |
// Loop through the Monetate Campaigns and add values to usblCustom Object. | |
// Please note, that the Monetate campaign object is only available within the Monetate "Custom Report" JavaScript console. | |
for (var i = 0; i < campaigns.length; i++) { | |
var monetateCounter = i.toString; | |
usblCustom["MonetateId-" + monetateCounter] = campaigns[i].id; | |
usblCustom["MonetateKey-" + monetateCounter] = campaigns[i].key; | |
usblCustom["MonetateSplit-" + monetateCounter] = campaigns[i].split; | |
//Send custom variables by assigning the customObj to the 'custom' object in Usabilla | |
window.usabilla_live("data", { | |
"custom": usblCustom | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment