Last active
August 29, 2015 13:58
-
-
Save nathanbrauer/10408771 to your computer and use it in GitHub Desktop.
Marketo Forms 1.0 onSubmit Function
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
function onFormSubmit(callback) { | |
var oldFormSubmit = window.formSubmit; | |
window.formSubmit = function(elt) { | |
if (typeof callback == 'function') callback(elt); | |
if (typeof oldFormSubmit == 'function') oldFormSubmit(elt); | |
}; | |
} |
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
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