事件跟踪不起作用
问题描述:
我正尝试使用以下脚本将Google的事件跟踪集成到我的应用程序中。我可以在实时标签中看到事件。但是我无法在内容标签中看到这些事件。
I am trying to integrate the Google's event tracking on my application using the below script. I can able to see the Events in "Realtime" tab. But I am not able to see the events in "Content" tab.
var _gaq = _gaq || [];
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAccount', 'XXXXX']);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackEvent', 'request.fullpath', 'plan_desc', 'plan_code>']);
答
您是否抓取了定义gaq函数的脚本?
Are you grabbing the script that defines the gaq function?
var _gaq = _gaq || [];
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAccount', 'XXXXX']);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackEvent', 'request.fullpath', 'plan_desc', 'plan_code>']);
(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);
})();
另外,对于您的事件推送,您推送的值是否应该是JS对象?如果是这样,你可能想摆脱引号。
Also, for your event push, are the values you are pushing in supposed to be JS objects? if so, you may want to get rid of the quotation marks.