事件跟踪数据 – 显示多长时间?

我已经使用Google Analytics(分析)首次设置了事件跟踪。

我的帐户正在接收正常的stream量数据,但testing点击我正在做的不显示?

在closures前将ga.js跟踪代码添加到文档底部:

<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("<script src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'></script>")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-12365091-1"); pageTracker._trackPageview(); } catch(err) {}</script> 

添加了trackEvent代码如下:

 <a onclick="pageTracker._trackEvent('Showcase Data', 'Contact Details Viewed', 'PunkLogic - Sustainability through Creativity');" rel="facebox" href="#10" class="contact">Contact PunkLogic</a> 

这种types的数据显示需要一段时间吗? 还是我做错了什么?

谢谢。

Google Analytics(分析)不提供实时统计信息。

大多数情况下,统计数据需要几个小时才能显示出来。

更新:这个答案现在已经过时了。 正如@shanabus在评论中提到的那样,Google现在提供了实时统计信息 。

您无法立即查看活动数据。 似乎有几个小时到一天之间的延迟。

虽然在提问时你的代码可能是正确的,但是现在的实现方法如下。 强烈build议您升级以利用asynchronous行为。

 // After initializing ga.js asynch: _gaq.push(['_trackEvent', category, label, value, non-interact]); // Source: https://developers.google.com/analytics/devguides/collection/gajs/ 

无论您决定使用哪种方法发送跟踪事件,都可以使用Chrome的gadebugging器来debugging过程:

https://chrome.google.com/webstore/detail/jnkmfdileelhofjcijamephohjechhna

典型的故障将如下所示:

 _gaq.push(['_trackEvent', 'asdf', 'test', 'test', 'test', true, 'test']); _gaq.push processing "_trackEvent" for args: "[asdf,test,test,test,true,test]": The _trackEvent API expects a number value for argument 3. The argument given (test) was a string. 

一个成功的传输将显示更多的信息:

 _gaq.push(['_trackEvent', 'asdf', 'test', 'test', 123, true]); _gaq.push processing "_trackEvent" for args: "[asdf,test,test,123,true]": Track Event Tracking beacon sent! Account ID : UA-xxxxxxxx-1 Page Title : xxxxx.com Host Name : xxxxx.com Page : / Referring URL : - Hit ID : 1103xxxxxxx Hit Type : event Event Name : asdf Event Type : test Event Label : test Event Value : 123 Visitor ID : 14044xxxxx Session Count : 8 Session Time - First : Thu Jun 07 2012 22:25:11 GMT 1000 (EST) Session Time - Last : Thu Jun 14 2012 22:45:08 GMT 1000 (EST) Session Time - Current : Fri Jun 15 2012 12:30:21 GMT 1000 (EST) Campaign Time : Thu Jun 07 2012 22:25:11 GMT 1000 (EST) Campaign Session : 1 Campaign Count : 1 Campaign Source : xxxxxxxx Language : en-gb Encoding : UTF-8 Flash Version : 11.2 r202 Java Enabled : true Screen Resolution : 1280x800 Browser Size : 1921x593 Color Depth : 24-bit Ga.js Version : 5.3.2d Cachebuster : 1724882479 

其他debugging环境在这里build议:

https://developers.google.com/analytics/resources/articles/gaTrackingTroubleshooting#debuggingTools

截至2014年事件现在将实时显示。 谷歌分析截图

您可以通过使用Google Analytics实时查看您的代码。 转到此url查看: https : //www.google.com/analytics/web/#realtime/

事件不能在这里看到,但页面浏览可以。

事件发生后,我的GA事件通常会显示约30分钟,但有时会更快。 我也经历了较慢的更新,但从来没有几天。

编辑

GA现在提供实时统计信息,您的更新应该立即进行。

编辑

事件stream现在也存在,这是有帮助的。

我可以证实,这需要不到一天的时间。 之后,实时按预期工作。 我已经使用下面的语法在HTML框中设置了出站链接的事件跟踪:

 <a onclick="_gaq.push(['_trackEvent', 'outbound', 'link', 'linkname']);" href="www.domain.com" target="_blank">Anchor Text</a> 

希望能帮助到你