a) a visit’s campaign information can’t be viewed in a GA cookie anymore, and
b) session timeout information can be set within the GA Admin interface, as shown in the screenshot.
[original post follows]
Google Analytics has 3 main cookies: utma, utmb, and utmz. An older version of GA had a utmc session cookie, but this has been deprecated. There is also a utmv cookie for custom variables, but this post will focus on the 3 main cookies that you will see in every instance of GA.
The utma cookie, or “visitor” cookie has a 2 years expiration period. Each time a user comes to the site, their cookie gets updated for another 2 years.
The utmz cookie or “campaign” cookie has a 6 month expiration period. If a user comes back to the site within 6 months, it will remember the last traffic source of that visitor. It will typically be overwritten when a user comes back to the site after using a new traffic source, unless they come back as direct traffic (by typing in the URL, clicking on a bookmark,etc). In that case, the utmz cookie will still remember that they previously came from, say, an AdWords link and attribute their actions to AdWords.
The utmb cookie, or “session” cookie, has a 30 minute expiration period. If a user comes back to site within 30 minutes, it gets counted as part of the same session (as long as it’s the same campaign source and the day hasn’t changed).
See the below table for a summary of the above.
|Cookie||Cookie Type||Expiration Period||Purpose|
|utma||Visitor||2 years||creates persistent ID to track visitors across multiple visits|
|utmz||Campaign||6 months||identifies which traffic source brought the user to the site|
|utmb||Session||30 minutes||ties together all page views and actions within a visit|
An interesting GA tweak is that the expiration period for each of these can be modified using GA’s cookie timeout functions. There are a couple reasons users might want to do this:
1) users may want to change these settings to match their business rules. For example, their business may want to wait longer than a 30 minute period of inactivity before determining that a new session has started.
2) this can be used to match privacy policies, if certain local laws do not allow tracking users for extended periods of time or limit the length of expiration for these cookies.
The way to modify these settings is using the following 3 functions, which match to the above cookies as follows:
_utma cookie: _setVisitorCookieTimeout(enter_cookie_timeout_value_in_milliseconds)
_utmz cookie: _setCampaignCookieTimeout(enter_cookie_timeout_value_in_milliseconds)
_utmb cookie: _setSessionCookieTimeout(enter_cookie_timeout_value_in_milliseconds)
To use these functions, add them to the main tracking code block that goes on every page.
For more details please see https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration