Skip to content

Instantly share code, notes, and snippets.

@chexton
Created November 13, 2013 04:26
Show Gist options
  • Save chexton/7443681 to your computer and use it in GitHub Desktop.
Save chexton/7443681 to your computer and use it in GitHub Desktop.
add-vero-unbounce-js.js
//1. Return to the 'Form Confirmation Dialogue' editor tab
//2. Click the Javascripts button in the bottom left of the editor
//3. Paste the tracking code into the scripts dialogue
//4. Name your script 'KISSmetrics Conversion Event'
//5. Choose 'Head' in the placement dropdown menu
<script type="text/javascript">
var getUrlParams = function () {
var params = {},
hash;
var hashes = decodeURI(window.location.href).replace(/\+/g," ").slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
params[hash[0]] = unescape(hash[1]);
}
return params;
};
var urlParam = getUrlParams();
var identifier = urlParam['email'];
if (identifier != undefined) {
_veroq.push(['user', {email: unescape(identifier)}]);
}
_veroq.push(['track', 'Unbounce Email Submit']);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment