Google Analytics脚本不会发送跟踪信标

时间:2013-11-07 14:01:29

标签: google-analytics google-analytics-api

在jspx文件中,我有js脚本用于跟踪登录提供商(用户通过电子邮件,脸书或推特登录)。

var statsAnalytics = "${jndiSettings['statsAnalytics']}";

var _gaq = _gaq || [];
_gaq.push(['_setAccount', statsAnalytics]);
_gaq.push(['_trackPageview']);

(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

var providerId = '${providerId}';

if (providerId) {
    _gaq.push(['_trackEvent', 'Sign in', providerId, 'Signed in with ' + providerId]);
}

使用GA调试器调试Chrome后,我得到了:

_gaq.push processing "_setAccount" for args: "[UA-xxxxxxx-x]":  [VM] ga_debug.js (9935):24
_gaq.push processing "_trackPageview" for args: "[]":  [VM] ga_debug.js (9935):24
Track Pageview [VM] ga_debug.js (9935):24
_gaq.push processing "_trackEvent" for args: "[Sign in,facebook,Signed in with facebook]":  [VM] ga_debug.js (9935):24
Track Event

为什么我的脚本不发送跟踪信标?

1 个答案:

答案 0 :(得分:0)

我使用AdBlock禁用屏蔽广告,现在可以正常使用了!