magento - 设置谷歌分析magento

标签 magento google-analytics installation

您好,我已添加 Google 分析 帐号管理中的号码,我是否还需要在文件中添加谷歌跟踪代码以进行跟踪,在谷歌中它仍然显示

The Google Analytic tracking code has not been detected on your website's home page



请告诉我如何将 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” block 。在您的 XML 布局更新中搜索包含“google_analytics”的行 - 可能有一个具有此名称的“删除”节点。
  • 模板文件“googleanalytics/ga.phtml”不可读或丢失
  • 在“Web”下设置“Cookie Restriction Mode”设置为“yes”也会阻止代码输出
  • 关于magento - 设置谷歌分析magento,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14837884/

    相关文章:

    mysql - 字段未插入或更新,sql 中的 int 类型

    installation - Inno Setup 中的函数指针

    R包安装

    ruby-on-rails - Rails 4 turbolinks 与谷歌分析

    .net - Wix 安装程序和 XSLT - 省略特定目录中的某些文件

    php - 用于对 magento 集合进行排序的多个字段

    magento - 如何在 magento 的 phtml 文件中调用 cms 页面?

    php - 查找并替换 html(Zend_Dom_Query+createElement()) : Call to a member function createElement() on a non-object

    google-apps-script - 如何通过 API 访问特定 View 或属性的 Google Analytics 过滤器

    google-analytics - 如何访问行为流数据? (在应用程序 Google Analytics 帐户上。)