Google Analytics跟踪Google云端硬盘公共文件夹中托管的网页

时间:2014-02-22 00:21:37

标签: google-analytics google-drive-api

我在html页面中添加了一项Universal Analytics跟踪代码,该代码托管在Google云端硬盘的公共文件夹中。

页面工作正常,但我在Google Analytics中的行为 - 概述报告中看不到该页面的任何痕迹。

我是否遗漏了基本的内容或Google云端硬盘中存在一些我不知道的限制?

这是代码片段

// some other script ending here...
</script>

<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-12345678-9', 'mydomain.com');
  ga('send', 'pageview','/mappingHtml');
</script>

</html>

谢谢,Fausto

1 个答案:

答案 0 :(得分:1)

文档不清楚,但在ga Object Methods for create中,您可以将trackingId设置为auto eg。

ga('create', 'UA-12345678-9', 'auto');

这应启用跟踪功能(或者使用ga('create', 'UA-12345678-9', 'googledrive.com');的Google云端硬盘托管内容也可以启用