Skip to content

Instantly share code, notes, and snippets.

@PierreAmmeloot
Created July 6, 2016 15:41
Show Gist options
  • Save PierreAmmeloot/2fc349bf13718bcac88ebc8ffbdc7f01 to your computer and use it in GitHub Desktop.
Save PierreAmmeloot/2fc349bf13718bcac88ebc8ffbdc7f01 to your computer and use it in GitHub Desktop.
<script>
function getSearchParameters() {
var prmstr = window.location.search.substr(1);
return prmstr != null && prmstr != "" ? transformToAssocArray(prmstr) : {};
}
function transformToAssocArray( prmstr ) {
var params = {};
var prmarr = prmstr.split("&");
for ( var i = 0; i < prmarr.length; i++) {
var tmparr = prmarr[i].split("=");
params[tmparr[0]] = tmparr[1];
}
return params;
}
var params = getSearchParameters();
(function(w,d,t,u,n,a,m){w['MauticTrackingObject']=n;
w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},a=d.createElement(t),
m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://pam.automation.webmecanik.com/mtc.js','mt');
mt('send', 'pageview', {email: params.email, firstname: params.firstname, lastname: params.lastname, tags: params.tags});
document.write("email: "+params.email+"<br />firstname: "+params.firstname+"<br />lastname: "+params.lastname+"<br />tags: "+params.tags);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment