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

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

问题描述

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



我看到从我的browswer到google-analytics.com上的文件( http: //www.google-analytics.com / __ utm.gif?.. ),但在过去,我被告知它需要存在于网站的根目录中。



这是否仍然适用?

您能否提供参考?

解决方案

如果您使用的是新版本的跟踪代码( ga.js ),则仅限 您需要做的是包含以下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>

这意味着您不需要托管任何 __ 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天全站免登陆