Google Analytics事件跟踪器

时间:2014-07-15 12:39:51

标签: html google-analytics

我没有在Google-Analytycs网站上收到“点击”活动信息,我花了大约3天时间等待...

我的代码如下所示:

<HEAD>
    <!-- Google Website Tracking -->
    <script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-51234567-1', 'auto');
  ga('send', 'pageview');
    </script>

    <!-- Google Event Tracking -->
    <script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-51234567-1']);
  _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);
  })();

</script>

.. Not Relevant code

</HEAD>

(我替换了一些用于制作此帖子的UA代码,但长度和结构是相同的)

然后,为了跟踪事件,我使用此代码:

<A HREF="LINK" onClick="_gaq.push(['_trackEvent', 'External Link', 'External Web', 'TEXT']);"><FONT size="5">TEXT</FONT></A>

当然,LINK是一个真正的链接,TEXT是网站的名称。

当我访问Google分析网站时,admin>Tracking Info>Tracking Code>我得到Status: Receiving Data。在那个网站上,我确实获得了页面查看信息,一切似乎都没问题,但我没有收到“点击事件”信息。也许我正在寻找错误的地方,但我不这么认为,因为我到处都看!

0 个答案:

没有答案