function fireEAndEEvent(eventname, detail){
if (window.CustomEvent) {
var event = new CustomEvent(eventname, {detail: detail});
}
else if(typeof document.createEvent == 'function') {
var event = document.createEvent('CustomEvent');
event.initCustomEvent(eventname, true, true, detail);
}
else {
'console' in this && !!console.warn && console.warn('Custom Event unavailable for analytics.');
}
document.dispatchEvent(event);
}
//We'll use 'eande_emailsignup' as the name for the event. Send vertical for the signup as the 'vertical' property of the second argument (one of ['business','k12','publicsector','highered']) - it will default to 'business' (event42 in analytics).
//When someone signs up, call the function like so: fireEAndEEvent('eande_emailsignup', {vertical:'k12'})