Created
October 22, 2017 00:34
-
-
Save agarwa13/85223072e02f2928ec6d8db2ba25063c to your computer and use it in GitHub Desktop.
Google Analytics Event on Form Submit
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
$('#replace-with-css-id-for-form').submit(function(e){ | |
e.preventDefault(); | |
_gaq.push(['_trackEvent', 'Forms', 'Submit', 'Home Contact']); | |
var form = this; | |
setTimeout(function(){ form.submit()}, 150); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment