Last active
July 12, 2024 15:43
-
-
Save joemidi/0d643a0b7e4c03983b974ac940fc568d to your computer and use it in GitHub Desktop.
Enabler exits
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 queryString = 'q=headphones'; | |
banner.addEventListener('click', function () { | |
Enabler.exitQueryString('clickthrough', queryString); | |
}); | |
// You can use the Enabler.exitQueryString() method to apply an query string to an exit URL. | |
// Note that the base URL will still come from within the Studio interface. | |
// Alternatively you can create the full URL yourself using Enabler.exitOverride() | |
var params = { | |
parameter1: 'value_1', | |
parameter2: 'value 2', | |
parameter3: 'value&3' | |
}; | |
// Encode your parameters so that they are URI safe | |
var esc = encodeURIComponent; | |
var queryString = Object.keys(params) | |
.map(function(k) {return encodeURIComponent(k) + '=' + encodeURIComponent(params[k]);}) | |
.join('&'); | |
// Build up the exit URL | |
var exitURL = 'https://myexit.url/' | |
var exitURLAndQuery = exitURL + '?' + queryString; | |
// Create click event for the Exit | |
banner.addEventListener('click', function () { | |
Enabler.exitOverride('clickthrough', exitURLAndQuery); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment