====== How can I record email conversion to split test ? ======
===== Get Email from QueryString =====
Suppose you have url like this : **http://www.example.com/?email=abc@example.com**
function getQueryStrings() {
var assoc = {};
var decode = function (s) { return decodeURIComponent(s.replace(/\+/g, " ")); };
var queryString = location.search.substring(1);
var keyValues = queryString.split('&');
for(var i in keyValues) {
var key = keyValues[i].split('=');
if (key.length > 1) {
assoc[decode(key[0])] = decode(key[1]);
}
}
return assoc;
}
var param= getQueryStrings();
var _email = param["email"];
Now, You can grab email from either queryString and send data to cbsplit CallBack **recordEmailConversion()**
JavaScript Function Call is promised based:
recordEmailConversion(_email).then(function() {
// continue to your next task
});
===== Incase you are using HTML