I\'m working on a tracking script for a fairly sophisticated CRM for tracking form actions in Google Analytics. I\'m trying to balance the desire to track form actions accuratel
If you must have forms always work but tracking can be sacrificed if absolutely necessary, you could just try/catch it.
$('form').submit(function(e){
try{
e.preventDefault();
var form = this;
_gaq.push('_trackEvent', 'Form', 'Submit', $(this).attr('action'));
//...do some other tracking stuff...
setTimeout(function(){
form.submit();
}, 400);
} catch (e) {
form.submit();
}
});