Show Menu

Google Analytics Cookies (v2) Cheat Sheet by Jay Taylor

An overview of the anatomy of the cookies set and used by Google Analytics.

__utma (Visitor cookie)

Block oneDomain hash
Block twoVisitor ID
Block threeTime of initial session
Block fourTime of previous session
Block fiveTime of current session
Block sixSession number

Each group is separated by a period character. All times stored are UNIX timest­amps. For new visits the three times in this cookie will all be the same.

__utmb (Session cookie)

Block oneDomain hash
Block twoPageviews this session
Block threeTokens available
Block fourTime of session

Each group is separated by a period character. All times stored are UNIX timest­amps.

The token bucket stores how many requests are being made to GA at once. This number will decrease for each request, any requests sent while the bucket is empty will be discarded.

__utmc (Session cookie)

Block oneDomain hash

This cookie is deprecated due to session handling changes within Analytics, but is still set by ga.js. Sessions now only end when the __utmb cookie expires.


__utmv (Custom Variable cookie)

Block oneDomain hash
Block twoCustom Variable value

Each group is separated by a period character. This cookie can only be created by using Google Analytics' deprecated _setVar() method. Calling this method sets this cookie and automa­tically sends the data to Google Analytics via a __utm.gif request.

Values sent in this manner appear in the "User Define­d" report, unless otherwise interc­epted with profile filters.

__utmm­obile (Mobile Visitor cookie)

Block oneVisitor ID

This cookie is only created by the Google Analytics mobile tracking SDK. It stores an ID generated by MD5 hashing several possible values, and then returning a substring of the result prefixed with '0x' - this serves as a unique visitor ID.

This cookie is used as a basic Visitor cookie, similar to __utma.


__utmz (Campaign cookie)

Block oneDomain hash
Block twoTime of initial visit
Block threeSession number
Block fourCampaign number
Block fiveCampaign parameters

Each group is separated by a period character. The campaign parameters are a single URL-en­coded string, separated by pipe '|' charac­ters. They can include:

utmcsr = source
utmcmd = medium
utmccn = campaign name
utmctr = campaign keyword
utmcct = campaign content / variation
utmgclid = Google Click ID

utmg­clid will only be set for AutoTagged AdWords visits. If set, other parameters will be unset, as utmgclid is a hash of the campaign values and is used instead.

Cookie Lifetimes

__utmaTwo years
__utmbThirty minutes *
__utmcUntil browser is closed
__umtvTwo years
__utmzSix months
__utmm­obileTwo years

* the __utmb cookie will only expire after thirty minutes of no intera­ction with Google Analytics, i.e.: idle time.


Share This Cheat Sheet!

Favourited by 8 Members:

Chilly_Bang kinaze cthumerelle MrChick The_Frail schrodervictor mishin kagua


prietop prietop, 13:55 16 Mar 12

Hi Jay,

I hoe you can help me cause i am really stumped, im trying to save into a lead database the info from the cookie, i tried with auto-tagging on from adwords and i get the campaign as "Not Set" i unlinked my Adwords from analytics and turned auto-tagging off and now i get all adwords clicks as "organic".. Can you help??

Jay Taylor Jay Taylor, 09:25 21 May 12

Hello! Sorry for the delayed reply - I haven't managed to check back in for a while.

When using autotagging, all of the campaign info gets stored in the encoded GCLID parameter generated by AdWords, the only info you'll be able to extract is the GCLID and the fact it's a CPC visit. If you disable auto-tagging you need to make sure that each of your destination URLs is manually tagged with UTM parameters identifying it as CPC - for example:

Of those five parameters, utm_source, utm_medium and utm_campaign are mandatory, Google has documentation available on these though, if you search for Google URL Builder they have a tool up for generating manually tagged campaign URLs.

So to answer your question more directly - if you want to extract cookie for CPC data, you'll need to manually tag your URLs as above, auto-tagging won't give you that data in the Cookie!

Hope that helps, again sorry for the delay in replying :-)

MrChick MrChick, 11:38 8 Jan 13

Hey Jay,

in the Cookie Lifetimes section __umtv should be __utmv, shouldn't it?

vinay vinay, 09:06 26 Feb 14

How to get the landing page URL using Google Analytics _UTM Cookies

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.