Project

General

Profile

Google(谷歌)Cookie跟踪分析-付培举(2013-11-5)

技术文档
11/05/2013

谷歌跟踪代码开发文档:https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration?hl=zh-CN&csw=1
下面是个简单的介绍,详细的看压缩文档

谷歌COOKIE会在用户浏览器种下4个utma utmb utmc utmz
__utmz:跟踪访问者是从哪里来的(搜索引擎,搜索关键字,链接地址);

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

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

设置GA COOKIE有效时间
_setVisitorCookieTimeout()

_setVisitorCookieTimeout(cookieTimeoutMillis)
Sets the Google Analytics visitor cookie expiration in milliseconds. By default, the visitor cookie is set to expire in 2 years. If you prefer, you can change the expiration date of the visitor cookie using this method. You can change the expiration timeout to 0 to indicate that this cookie should be deleted when the browser is closed.

Async Snippet (recommended)
_gaq.push(['_setVisitorCookieTimeout', 63072000000]);

Traditional (ga.js) Snippet
pageTracker._setVisitorCookieTimeout(63072000000); //number of milliseconds in 2 year

Files

谷歌来源跟踪.zip (117 KB) 谷歌来源跟踪.zip 付培举, 11/05/2013 02:46 PM