简体   繁体   中英

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 eg when a form field is completed/skipped but can't seem to get this one to work.

Any idea?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM