嗨,我已经在管理员中添加了Google解析帐号,我是否还需要在要跟踪的文件中添加Google跟踪代码,在Google中它仍显示


您尚未检测到Google Analytic跟踪代码
网站首页


请告诉我如何设置我网站的Google分析。

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'xxxxxxxx']);//fake
  _gaq.push(['_setDomainName', 'fake.com']);//fake
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>


我是否需要在文件中添加这种类型的代码

最佳答案

在管理员中设置帐户后,应自动输出JS代码。它仍然不是的可能原因是:


“ Google Analytics(分析)”模块的输出已禁用。如果是这样,请在“配置” =>“高级”下进行检查。
某些布局更新删除了“ google_analytics”块。在您的XML布局更新中搜索包含“ google_analytics”的行-可能存在一个具有该名称的“删除”节点。
模板文件“ googleanalytics / ga.phtml”不可读或丢失
在“ Web”下将“ Cookie Restriction Mode”设置为“ yes”也会阻止代码输出

10-07 19:09
查看更多