user1961082
user1961082

Reputation: 1035

Google Analytics Event Tracking - Page Exit

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?

Upvotes: 1

Views: 349

Answers (1)

Yeronimo
Yeronimo

Reputation: 1749

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]);

Upvotes: 2

Related Questions