How to read Google Analytics cookie values

Written by Dan

Topics: Google Analytics

Understanding the information contained within a GA cookie is useful for debugging as well as deciphering what information is being stored about you on each visit to a website.

How do you get to see them? The easiest way is to visit the site in Firefox, open FireCookie (F12), navigate to the Cookies tab. You’ll now see all the active cookies for that session.

I usually put “__” (that’s two underscores) in the search box on the right and hit return, this cleans out most of the non-GA tags.

What you’re left with is something like this:

cookies-in-firecookie

The first thing to notice in this example is that it’s not just my site that’s tracked your presence here – my twitter and backtype plug-ins have each dropped a cheeky tracking cookie in too. Of course we are just looking at Google Analytics cookies here so there could be more from other vendors (I’ll cover that in a future post).

What does this all mean then? Google Analytics cookies are made up of six key variables:

  • __utma =<domain>.<visitorID>.<first visit>.<last visit>.<current visit>.<session>
    This defines you as a site visitor. It’s a ‘persistent’ cookie which means it’ll remain on your device and identifies you as the same visitor on each visit (unless you delete your cookies of course).
    <domain>: a hash of the domain where the cookie was set
    <visitorID>: a random number which identifies you as an individual
    <first visit>: the unix timestamp of your first visit to the site
    <last visit>: the unix timestamp of your last visit to the site
    <current visit>: the unix timestamp of your current visit to the site
    <session>: the count of your sessions (visits)
  • __utmb
    This is the session identifier. It is non-persistent so it dies after 30 minutes of non-activity on the site.
  • __utmc
    Similar to utmb, this is the second session identifier. It is non-persistent and dies when the browser window is closed. By using both utmb and utmc together, Google knows when your session has come to an end.
  • __utmz =<domain>.<current visit>.<session>.1.utmcsr=<source> |utmccn=<campaign>|utmcmd=<medium>|utmctr=<keyword>
    I generally find this is the most useful cookie to look for. It tracks the source from which you entered the site, known as the referral. It is persistent, but will update to the latest source method, unless you come to the site direct in which case it retains the previous source data.
    <domain>: a hash of the domain where the cookie was set
    <current visit>: the unix timestamp
    <session>: the count of your sessions (visits)
    <source>: the source (eg google)
    <campaign>: the campaign (eg organic)
    <keyword>: the keyword (eg pies)
  • __utmv =<domain>.<custom var>
    This is used to store custom variables, so it will not be set unless the site is using this functionality.
  • __utmx
    This is used to store the variation of the page viewed if the site is undergoing a Google Website Optimiser programme, so it will not be set unless the site is using this functionality. It ensures that the same version of the page is used if the visitor views the page over multiple visits.

I find in practice, the most common use of this information is to check referrals are registering correctly.

The most common problems you may need to look out for are javascript or flash redirects which do not pass referral information correctly, or internal site links which overwrite the referral information.


About the author:  Dan Huddart is a web analytics professional, specialising in obtaining business insight from Google and Adobe/Omniture analytics solutions.
Read more from this author


5 Comments Comments For This Post I'd Love to Hear Yours!

  1. GajuNo Gravatar says:

    Hi Dan,

    Loved the way you have laid it out here. Just the thing I was looking for.

    One question: I tried to set a cookie with google analytics to stop it from tracking my own visits. Google asked me to insert a variable test_value and then block with a custom filter. However, I’m unable to find that variable anywhere. Where should I be looking?

    Thanks,
    Gaju

    • DanNo Gravatar says:

      Hi Gaju,

      The variable you set in the cookie can be filtered using the ‘User defined’ field.

      So your filter settings would be:

      Customer filter
      Exclude
      User defined
      ‘test_value’ or whatever you set in the cookie

      Hope that helps?
      Dan

      • GajuNo Gravatar says:

        Dan,

        Thanks for getting back. I apologize for not being supremely clear. The Google instructions were clear enough from their website. I meant, I was trying to see if the cookie was set on my personal computer. A screenshot will make things clear.

        http://www.flickr.com/photos/9282569@N06/6226639819/

        I understand the ‘values’ might be hashed. But doing a simple check would be reassuring.

        -Gaju

        • GajuNo Gravatar says:

          To clarify the screenshot: The browser is Chrome and I am the preferences>under the hood>all cookies.

        • DanNo Gravatar says:

          Hi Gaju,

          To verify the cookie, look for the _utmv and you should see the variable you have set.

          I’ll walk you through an example. I use Firebug and Firecookie in Firefox to do the following:

          1) Browse to the website you are measuring

          2) Within the Firebug console run the following code, which will record a cookie with a value of ‘Blocked’:

          javascript:void(function(w){try{_gaq._getAsyncTracker()._setVar(w)}catch(e){try{__utmSetVar(w)}catch(e){pageTracker._setVar(w)}}alert(w)}(‘Blocked’));void(0);

          3) To verify it has worked, open Firecookie and find the _utmv cookie, which now has a value of “92719437.Blocked”

          The same can be achieved in Chrome using its equivalent features.

          Let me know how you get on
          Dan

Leave a Comment Here's Your Chance to Be Heard!