Skip to content

Instantly share code, notes, and snippets.

@andregoncalves
Created October 27, 2012 10:35
Show Gist options
  • Save andregoncalves/3964111 to your computer and use it in GitHub Desktop.
Save andregoncalves/3964111 to your computer and use it in GitHub Desktop.
Analytics form submit tracking 2
$("form").on('submit', function(e) {
var form = this;
if (_gaq) {
e.preventDefault();
_gaq.push(['_trackEvent', 'my category', 'my action']);
setTimeout(function() { form.submit(); }, 100);
return false;
}
return true;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment