为什么我得到“存储不可用。中止打击。使用Google Analytics(分析)? [英] Why do I get 'Storage not available. Aborting hit.' with Google Analytics?

查看:167
本文介绍了为什么我得到“存储不可用。中止打击。使用Google Analytics(分析)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设置新的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标签中有这个,因为Google告诉你做
显然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(分析)调试扩展程序时,我会收到以下消息:

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有关。在我的情况下,当我在测试本地主机时,我没有将cookieDomain设置为没有。

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'
});

这篇关于为什么我得到“存储不可用。中止打击。使用Google Analytics(分析)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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