Created
October 20, 2017 20:29
-
-
Save cougrimes/3c2b64d32a68c08f620ee93d00a0bb1a to your computer and use it in GitHub Desktop.
Send Google Analytics event on Marketo form submission
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MktoForms2.whenReady(function(form) { | |
form.onSuccess(function(vals, page) { | |
ga('send', 'event', { | |
eventCategory: 'Marketo Form', | |
eventAction: 'Form Submission', | |
eventLabel: formName, | |
hitCallback: function() { | |
document.location.href = page; | |
}; | |
}); | |
return false; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment