关于 cookie 中遇到的 utma utmz 的疑问

华宰 发布于 2012/06/03 09:09
阅读 1K+
收藏 2

 网上看到的文章:http://blog.csdn.net/ivanyoung66/article/details/4142523

由于第一次研究cookie,在分析校内的cookie的时候,遇到了一些__utma utmz的Name,参数的内容完全分析不懂,经多方求教,终于知道了原来那些代码竟然是Google的免费网站统计系统产生的信息(垃圾代码害得我浪费了整整一天),Down下来了它的生成文件:Urchin.js 几千行代码看的我脑袋发木,最后百度搜索寻求不到结果,求助于Google,才得到了如下的信息:

This article/section is a stub.
It is here because it was planned, created to drop some preliminary notes. Statements may be wrong, and the style and structure may suck. Feel free to add further notes or suggestions, rewrite sections or the whole into something understandable.

The cookies named:

  • __utmv is used for user-custom variables in Analytics
__utma
__utmz

...and others are part of Google Analytics, specifically the Urchin tracking module. These cookies track usage on sites that use Google Analytics.


Some details:

  • __utmz tracks where a visitor came from (search engine, search keyword, link)
  • __utma tracks each user's amount of visits, first, last visit.
  • __utmb and __utmc are used to track when a visit starts and ends to some decent time resolution (c expires quickly). If you look at cookie state changes (e.g. using firecookie), you will see these change a lot .

如上,英文的内容实在让人看得头痛,下面简要翻译下各个参数的内容:

__utmz:跟踪访问者是从哪里来的(搜索引擎,搜索关键字,链接地址);

__utma:跟踪每个用户的大量访问,第一次,最后一次;

__utmb和__utmc是跟踪每个用户的访问时间,从开始到结束。

我的问题是这个 Google 的 js 怎么会把 cookie 写到网站的域名上呢?

加载中
0
deleted
deleted
用js写的, 网站通过js script引用google统计的代码后,google统计代码的js自然可以操作该域下的document.cookie了
0
Xiaopeng
Xiaopeng
因为你的浏览器不支持Cookies,所以你会在URL上看到这些信息。Google通过__utma, __utmb, __utmc, __utmz等Cookies来进行信息追踪,当你禁止使用Cookies时,你的浏览器就会将这些信息作为GET参数传递至URL。详细可点此: https://developers.google.com/analytics/resources/concepts/gaConceptsCookies?hl=zh-CN
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部