1

I'm trying to track when a user exits the page using the code below but it doesn't seem to be firing the event:

function storeData(){

            _gaq.push(['_trackEvent', 'Application Form', 'exit-form_application_', 4, '', false]);
        }
$(window).on('unload',storeData);

I've also tried other ways such as the method shown here but I still can't get it to fire. I have other events which are firing successfully e.g when a form field is completed/skipped but can't seem to get this one to work.

Any idea?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user1961082
  • 1,015
  • 17
  • 41

1 Answers1

2

Is not firing at all or is just not registering the event? If last, then maybe order of your variables is wrong I think. Value needs to be a number. Maybe this will work better?

_gaq.push(['_trackEvent', 'Application Form', 'exit-form_application_', '', 4, false]);
Yeronimo
  • 1,731
  • 15
  • 28
  • I've got another question actually which I've asked here - http://stackoverflow.com/questions/16565433/google-analytics-track-event-on-page-exit-except-form-submission if you can help? Thanks – user1961082 May 15 '13 at 12:48