Your browser (Internet Explorer 7 or lower) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.

X

Navigate / search

How Google Analytics uses cookies to track your visitors

If you have ever used Google Analytics, you will notice that it tracks how users behave on your site – from which pages they click, which products they purchase, which terms they search, to which browsers they use. It is all done by way of setting/getting different cookies on your customer’s computers, and using those to track them.

Here are some frequently used scenarios and how Google Analytics deals with them.

How is a user session determined?
A visitor session ends after 30 minutes of inactivity on your website, or when the browser exits. Google Analytics is able to determine the start of a new session by the absence of either session cookie. Cookie : __utmb, __utmc

How is a unique visitor identified by use of cookies?
Each unique browser that visits a page on your site is provided with a unique ID via the __utma cookie. In this way, subsequent visits to your website via the same browser are recorded as belonging to the same (unique) visitor. Cookie : ___utma

How are traffic and referral sources tracked?
When visitors reach your site via a search engine result, a direct link, or an ad that links to your page, Google Analytics stores the type of referral information in a cookie. Cookie : __utmz

How can you track custom information using cookies supplied by Google Analytics?
You can define your own segments for reporting on your particular data. When you use the _setVar() method in your tracking code to define a custom user segment, Google Analytics uses this cookie to track and report on that information. Cookie : __utmv

How can perform A/B tests using cookies?
You can use Google Analytics with Google Website Optimizer (GWO), which is a tool that helps determine the most effective design for your site. Cookie : __utmx

Guide to Google Analytics Cookies:

Cookie FunctionCookie NameExpirtion
User Session__utmb
__utmc
30 minutes from set/update
Identifying Unique Visitors__utma2 years from set/update
Tracking Traffic Sources & Navigation__utmz6 months from set/update
Custom Tracking__utmv2 years from set/update
Website Optimizer__utmx2 years from set/update

Next week I will be going over how you can set custom variables on your site to track certain events/behaviors that are happening on your website back to Google Analytics.

Comments

arnabc
Reply

Great informative post, waiting for the next post on tracking events, good work Jake :-)

Brian Clifton
Reply

Hello Jake – I just stumbled on your site on my Friday morning reading round. Nice articles re: GA, WSO…

As you are obvious a GA enthusiast I thought you might be interested in this post from me this morning: http://www.advanced-web-metrics.com/blog/2010/02/

Brian Clifton
Author

Leave a comment

name

email (not published)

website