Google Analytics 和 __utm.gif 文件 [英] Google Analytics and the __utm.gif file

查看:19
本文介绍了Google Analytics 和 __utm.gif 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 Google Analytics 和更新的 ga.js 文件时,您网站的根目录中是否需要 __utm.gif 文件?

我确实看到我的浏览器正在调用 google-analytics.com 上的文件(http://www.google-analytics.com/__utm.gif?...),但过去我被告知它需要存在于网站的根目录中.>

这仍然适用吗?

您能提供参考吗?

解决方案

如果您使用的是新版本的跟踪代码 (ga.js),唯一的事情 您需要做的是包含这段 JavaScript:

<script type="text/javascript">var pageTracker = _gat._getTracker("UA-xxxxxx-x");pageTracker._trackPageview();

这意味着您不需要在您的服务器上托管任何 __utm.gif 文件(我不确定这无论如何如何用于分析,因为重点是以便客户端的浏览器向 Google 服务器发出请求).

When using Google Analytics and using the newer ga.js file, is the __utm.gif file needed in your root directory of your web site?

I do see a call being made from my browswer to the file on google-analytics.com (http://www.google-analytics.com/__utm.gif?...), but in the past I was told that it needed to exist in the root of the site.

Does this still hold true?

Could you please provide a reference?

解决方案

If you are using the new version of the tracking code (ga.js), the only thing you need to do is include this snippet of JavaScript:

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackPageview();
</script>

This would imply that there are no requirements for you to host any __utm.gif file on your server (I'm not sure how this would even work for analytics anyway, as the whole point is for the client's browsers to make requests to Google's servers).

这篇关于Google Analytics 和 __utm.gif 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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