【问题标题】:Google analytics Universal code not tracking谷歌分析通用代码不跟踪
【发布时间】:2014-05-20 04:35:08
【问题描述】:

我很难找到我在 GA 中可能犯的错误。我开发了一个使用默认通用跟踪代码的网站http://farmacia-milenium.com.ar。出于某种原因,脚本无法正常工作,我没有正确跟踪。不知道网站的某些代码会不会影响代码性能。

有人可以帮我吗?

问候

【问题讨论】:

    标签: google-analytics analytics universal


    【解决方案1】:

    Google Tag Assistant 说 analytics.js 脚本不可用,并且控制台(即在 Google Chrome 中)显示错误:

    拒绝执行内联脚本,因为它违反了以下内容 内容安全策略指令:“script-src 'self'”。

    由此看来,您的 content security policy 似乎需要进行调整,以允许将 Google Analytics(分析)代码注入页面。

    【讨论】:

    • 嗨,Eike,我都检查过了。由于某种原因,我拥有的 CSP 无法正常工作。我在我的 htaccess 标头集 Content-Security-Policy-Report-Only "default-src 'self';script-src 'self' www.google-analytics.com;report-uri cspbuilder.info/report/5831563474954060414"
    【解决方案2】:

    经过长时间的搜索,我找到了我的任务的解决方案:

    标头集 X-Content-Type-Options "nosniff" 标头集 X-XSS-Protection "1; mode=block" 标题集 X-Frame-Options "SAMEORIGIN" 标头集 Strict-Transport-Security "max-age=631138519" 标头未设置 Content-Security-Policy 标头添加 Content-Security-Policy-Report-Only "default-src 'self'; font-src data: 'self'; img-src data: http: 'self'; media-src *; object-src 'none' ; script-src data: http: 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; frame-src *; report-uri http://cspbuilder.info/report/CODE"

    【讨论】:

      猜你喜欢
      • 2013-12-06
      • 1970-01-01
      • 2014-02-15
      • 1970-01-01
      • 1970-01-01
      • 2011-07-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多