为什么我会收到“存储不可用.中止命中.使用谷歌分析? [英] Why do I get 'Storage not available. Aborting hit.' with Google Analytics?

查看:14
本文介绍了为什么我会收到“存储不可用.中止命中.使用谷歌分析?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用新的 Google Analytics(分析)跟踪代码进行设置.

I'm setting up with the new Google Analytics tracking code.

<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', 'MYUACODE', 'MYDOMAIN');
      ga('send', 'pageview', {
          'page': '/setup',
          'title': 'Setup Page'
        });

    </script>

我已经把这个放在我的 HEAD 标签里了,因为谷歌告诉你这样做显然 MYUACODE 和 MYDOMAIN 是我页面中的真正变量 :)

I've got this inside my HEAD tag as Google tell you to do Obviously MYUACODE and MYDOMAIN are the real variables in my page :)

但是,当我使用 Google Chrome 运行此程序并打开 Google Analytics Debug 扩展程序时,我收到以下消息:

However when I run this using Google Chrome and I turn on the Google Analytics Debug extension, I get the following message:

Registered new plugin: "linker"       analytics_debug.js:5
Creating new tracker: t0              analytics_debug.js:5
New visitor. Generating new clientId  analytics_debug.js:5
Storage not available. Aborting hit.  analytics_debug.js:5

它似乎正确启动并开始设置项目,但随后显示存储不可用,而且 Google 似乎没有收到任何信息.

It seems to fire up correctly and starts setting up the items, but then it says Storage not available and it seems nothing ever gets to Google.

现在,如果我删除所有这些代码并返回到原始的 Google 跟踪代码,它工作正常,但我似乎无法正确触发这种新样式.

Now if I remove all this code and go back to the original Google Tracking code, it works fine, I just can't seem to get this new style to fire correctly.

有什么想法吗?帮助?提前致谢

Any thoughts? Help? Thanks in advance

推荐答案

我有同样的错误信息.这似乎与无法正确设置 cookie 有关.就我而言,它发生在我测试 localhost 并且我没有将 cookieDomain 设置为 none 时.

I had the same error message. It seems to be related to not being able to set the cookie correctly. In my case, it happened when I was testing off localhost and I hadn't set my cookieDomain to none.

您可能想尝试以下类似的方法,看看它是否有效.我不确定您使用的传递域的方法是否有效.

You may want to try something like the following and see if it works. I'm not sure if the method of passing your domain that you have works.

ga('create', 'MYUACODE', {
  'cookieDomain': 'none'
});

这篇关于为什么我会收到“存储不可用.中止命中.使用谷歌分析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆