简体   繁体   English

Google Analytics 事件跟踪 - 页面退出

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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