Developers Diary

Jquery code for Analytics Event


var url = window.location.href;
url=url.split(".");
var subdomain = url[0];
console.log (subdomain);

$("form").submit(function(){
ga('send', 'event', 'FormSubmission', 'ClickedSubmit', subdoman);
});