Skip to content

Instantly share code, notes, and snippets.

@nathanbrauer
Last active August 29, 2015 13:58
Show Gist options
  • Save nathanbrauer/10408771 to your computer and use it in GitHub Desktop.
Save nathanbrauer/10408771 to your computer and use it in GitHub Desktop.
Marketo Forms 1.0 onSubmit Function
function onFormSubmit(callback) {
var oldFormSubmit = window.formSubmit;
window.formSubmit = function(elt) {
if (typeof callback == 'function') callback(elt);
if (typeof oldFormSubmit == 'function') oldFormSubmit(elt);
};
}
onFormSubmit(function(){
window._gaq = window._gaq || [];
_gaq.push(['_trackEvent', 'white paper', 'downloaded', '7 sins']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment