浏览器cookie的命名约定
我注意到网站设置的 cookie 都有以下名称
__utma, __utmb, __utmc, __utmz
这是约定吗?或者它是由某些服务器端语言创建的默认值?这些有具体的含义吗?这些是预期的吗?有人可以解释一下吗?
I notice that cookies set by sites all have the following names
__utma, __utmb, __utmc, __utmz
Is this a convention? Or is it the default values created by some server side language? Is there a specific meaning to these? Are these expected? Can some one explain?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些是 Google Analytics Cookie
__utma Cookie:
此 Cookie 是所谓的“持久”Cookie,因为它永不过期(从技术上讲,它确实会过期... 2038……但为了解释起见,我们假设它永远不会过期,永远)。此 cookie 会跟踪访问者访问与 cookie 相关的网站的次数、首次访问的时间以及最后一次访问的时间。 Google Analytics 使用此 cookie 中的信息来计算购买天数和访问次数等信息。
__utmb 和 __utmc Cookie:
B 和 C Cookie 是兄弟,共同计算访问需要多长时间。 __utmb 获取访问者进入站点时的确切时刻的时间戳,而 __utmc 获取访问者离开站点时的确切时刻的时间戳。 __utmb 在会话结束时过期。 __utmc 等待 30 分钟,然后过期。您会看到,__utmc 无法知道用户何时关闭浏览器或离开网站,因此它会等待 30 分钟才能发生另一个页面浏览,如果没有发生,它就会过期。
__utmz Cookie:
__utmz 先生会跟踪访问者来自哪里、您使用的搜索引擎、您点击的链接、您使用的关键字以及您访问时他们在世界的哪个位置一个网站。它会在 15,768,000 秒后过期,即 6 个月后过期。通过此 Cookie,Google Analytics 可以了解谁以及向什么来源/媒介/关键字分配目标转化或电子商务交易的功劳。 __utmz 还允许您通过对 Google Analytics 跟踪代码的简单自定义来编辑其长度。
__utmv Cookie:
如果您在 Google Analytics 中使用用户定义的报告,并在您的网站上编写了一些代码以进行自定义细分,则 __utmv Cookie 会设置在该人的计算机上,以便Google Analytics 知道如何对该访问者进行分类。 __utmv cookie 也是一个持久的、终身的 cookie。
摘自 GA 文章:
http://www.morevisibility.com/analyticsblog/from-__utma-to-__utmz-google-analytics-cookies.html
These are Google Analytics Cookies
The __utma Cookie:
This cookie is what’s called a “persistent” cookie, as in, it never expires (technically, it does expire…in the year 2038…but for the sake of explanation, let’s pretend that it never expires, ever). This cookie keeps track of the number of times a visitor has been to the site pertaining to the cookie, when their first visit was, and when their last visit occurred. Google Analytics uses the information from this cookie to calculate things like Days and Visits to purchase.
The __utmb and __utmc Cookies:
The B and C cookies are brothers, working together to calculate how long a visit takes. __utmb takes a timestamp of the exact moment in time when a visitor enters a site, while __utmc takes a timestamp of the exact moment in time when a visitor leaves a site. __utmb expires at the end of the session. __utmc waits 30 minutes, and then it expires. You see, __utmc has no way of knowing when a user closes their browser or leaves a website, so it waits 30 minutes for another pageview to happen, and if it doesn’t, it expires.
The __utmz Cookie:
Mr. __utmz keeps track of where the visitor came from, what search engine you used, what link you clicked on, what keyword you used, and where they were in the world when you accessed a website. It expires in 15,768,000 seconds – or, in 6 months. This cookie is how Google Analytics knows to whom and to what source / medium / keyword to assign the credit for a Goal Conversion or an Ecommerce Transaction. __utmz also lets you edit its length with a simple customization to the Google Analytics Tracking code.
The __utmv Cookie:
If you are making use of the user-defined report in Google Analytics, and have coded something on your site for some custom segmentation, the __utmv cookie gets set on the person’s computer, so that Google Analytics knows how to classify that visitor. The __utmv cookie is also a persistent, lifetime cookie.
taken from GA article:
http://www.morevisibility.com/analyticsblog/from-__utma-to-__utmz-google-analytics-cookies.html