未发送 Google Analytics GIF 请求 [英] Google Analytics GIF request not sent

查看:20
本文介绍了未发送 Google Analytics GIF 请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在设置 Google Analytics 时遇到了一些问题.我下载了 Chrome 的 Google Analytics 调试扩展,如果我查看控制台,__utm.gif 请求永远不会发送.我三重检查了我的代码,一切都很好.ga.js 调试版下载正常.事实上,我有与 这个从来没有得到答案的人...

I'm having some troubles setting up Google Analytics. I downloaded the Google Analytics Debugging extension for Chrome and if I take a look at the console, the __utm.gif request is never sent. I triple-checked my code, and everything is fine. The debugging version of ga.js is downloaded properly. In fact, I have the exact same problem as this guy that never got an answer...

为此,这是我的跟踪代码(当然,UA-#########-# 在我的原始代码中正确替换了)

For the sake of it, here is my tracking code (with UA-########-# properly replaced in my original code, of course)

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-########-#']);
_gaq.push(['_trackPageview']);

(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

一切都设置正确,这是我在控制台输出中得到的:

Everything is set up properly, and here is what I get in the console output :

_gaq.push processing : "[_setAccount, UA-########-#]"
_gaq.push processing : "[_trackPageview]"
Track Pageview

然后就没有别的了.我尝试使用我知道已安装 Google Analytics 的同事的个人网站,我可以看到对 .gif 文件的请求.

And then nothing else. I tried with a colleague's personal website that I know has Google Analytics installed and I can see the request for the .gif file.

有人遇到过这个问题吗?

Anyone ever had this problem ?

推荐答案

您是在 localhost 还是 Intranet 上测试您的站点?如果是这样,您可能需要添加

Are you testing your site on localhost or an intranet? If so, you may need to add

_gaq.push(['_setDomainName', 'none']);

之前_trackPageview

请参阅 Intranet 上的 Google Analytics和开发服务器了解更多信息...

See Google Analytics on Intranets and Development Servers for more info...

如果您在网址如下的网站上使用 Google Analyticshttp://intranet/ 或类似 http://mydevserver:12345 不会工作.

If you’re using Google Analytics on a site with a URL like http://intranet/ or something like http://mydevserver:12345 it won’t work.

具体来说,Google Analytics JS 代码不会发送跟踪点击 (__utm.gif) 到 GA 服务器.

Specifically, the Google Analytics JS code will not send the tracking hit (__utm.gif) to the GA servers.

我真的不知道具体细节,但我猜这个域散列代码在主机名中至少查找一个句点,并且不会如果没有找到,则工作.

I don’t really know the specifics, but I’m guessing that the domain hashing code looks for at least one period in the hostname and won’t work if it doesn’t find one.

这篇关于未发送 Google Analytics GIF 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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