jquery - Google analytics event tracking on javascript form -
how can add "_gaq.push([‘_trackevent’" code tell google track form submit event? not working right now!
i want track successful form subbmit events.
submithandler: function(form) { $('#loadinglizings').show(); $(form).ajaxsubmit({ type:"post", data: $("#lizings").serialize(), url:"assets/process_lizings.php", cache: false, success: function() { _gaq.push([‘_trackevent’, ‘form’, ’submitted’, ’lizings_form’,, ’true’]); $('#lizings :input').attr('disabled', 'disabled'); $('#lizings_form').fadeto( "slow", 0.05, function() { $('#loadinglizings').hide(); $('#lizingssuccess').fadein(); }); }, error: function() { $('#lizings_form').fadeto( "slow", 0.05, function() { $('#loadinglizings').hide(); $('#lizingserror').fadein(); }); } }); }
you have issue quotes code, assuming exact code have on site. you're using smart quotes, should replaced single quotes ('), this:
_gaq.push(['_trackevent', 'form', 'submitted', 'lizings_form']);
also, default, events interactive, don't need last "true" parameter.
Comments
Post a Comment