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 Function Cookie Name Expirtion
User Session __utmb
30 minutes from set/update
Identifying Unique Visitors __utma 2 years from set/update
Tracking Traffic Sources & Navigation __utmz 6 months from set/update
Custom Tracking __utmv 2 years from set/update
Website Optimizer __utmx 2 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.

Categories: Web Metrics

2 thoughts on “How Google Analytics uses cookies to track your visitors”

arnabc · February 12, 2010 at 6:24 am

Great informative post, waiting for the next post on tracking events, good work Jake 🙂

Brian Clifton · February 12, 2010 at 10:28 am

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

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts


Google Analytics: How to setup Site Search

A great feature within Google Analytics which is really easy to setup, is Site Search. It’s hidden within the content tab and once setup, you can find out how people are using your search on Read more…


Measuring Site Performance with Google Analytics

I have recently become more interested in Google Analytics over the past few years. I think its a combination of the improvements/availability of better features within Google Analytics coupled with my curiosity of trying to Read more…


Google Website Optimizer and other Google Tools

Recently at work I finally had the opportunity to try out Google Website Optimizer, which is an A/B and Multivariate testing tool. We wanted to test different creatives on a landing page to see which Read more…