Skip to content

Instantly share code, notes, and snippets.

@cougrimes
Created October 20, 2017 20:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cougrimes/3c2b64d32a68c08f620ee93d00a0bb1a to your computer and use it in GitHub Desktop.
Save cougrimes/3c2b64d32a68c08f620ee93d00a0bb1a to your computer and use it in GitHub Desktop.
Send Google Analytics event on Marketo form submission
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