Recently i came on a article on Google analytics cookie handling. I found this article is very important for all the website SEO people.

An HTTP cookie—commonly referred to as just “cookie”—is a parcel of text sent back and forth between a web browser and the server it accesses. Its original purpose was to provide a state management mechanism between a web browser and a web server. Without a cookie (or a similar solution), a web server cannot distinguish between different users, or determine any relationship between sequential page visits made by the same user. For this reason, cookies are used to differentiate one user from another and to pass information from page to page during a single user’s website session. A web server uses cookies to collect data about a given browser, along with the information requested and sent by the browser’s operator (the visitor). Cookies do not identify people, but rather they are defined themselves by a combination of a computer, a user account, and a browser.

How Google Analytics Uses Cookies

Google Analytics uses cookies to define user sessions, as well as to provide a number of key features in the Google Analytics reports. Google Analytics sets or updates cookies only to collect data required for the reports. Additionally, Google Analytics uses only first-party cookies. This means that all cookies set by Google Analytics for your domain send data only to the servers for your domain. This effectively makes Google Analytics cookies the personal property of your website domain, and the data cannot be altered or retrieved by any service on another domain.

The following table lists the type of information that is obtained via your Google Analytics cookies and used in Analytics reports.

Functionality Description of Cookie Cookie Used
Setting the Scope of Your Site Content Because any cookie read/write access is restricted by a combination of the cookie name and its domain, default visitor tracking via Google Analytics is confined to the domain of the page on which the tracking code is installed. For the most common scenario where the tracking code is installed on a single domain (and no other sub-domains), the generic setup is correct. In other situations where you wish to track content across domains or sub-domains, or restrict tracking to a smaller section of a single domain, you use additional methods in the ga.js tracking code to define content scope. See Domains & Directories in the Collection API document for details. All Cookies
Determining Visitor Session 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. You can customize the length of the default session time using the _setSessionCookieTimeout() method. __utmb
Identifying Unique Visitors 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. Thus, if a person interacted with your website using both Firefox and Internet Explorer, the Analytics reports would track this activity under two unique visitors. Similarly if the same browser were used by two different visitors, but with a separate computer account for each, the activity would be recorded under two unique visitor IDs. On the other hand, if the browser happens to be used by two different people sharing the same computer account, one unique visitor ID is recorded, even though two unique individuals accessed the site. __utma
Tracking Traffic Sources & Navigation 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. The parameters in the cookie value string are parsed and sent in the GIF Request (in the utmcc variable). The expiration date for the cookie is set as 6 months into the future. This cookie gets updated with each subsequent page view to your site; thus it is used to determine visitor navigation within your site. __utmz
Custom Tracking 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. In a typical use case, you might use this method to segment your website visitors by a custom demographic that they select on your website (income, age range, product preferences). ___utmv
Website Optimizer You can use Google Analytics with Google Website Optimizer (GWO), which is a tool that helps determine the most effective design for your site. When a website optimizer script executes on your page, a _utmx cookie is written to the browser and its value is sent to Google Analytics. See the Website Optimizer Help Center for more information. ___utmx

Once the cookies are set/updated on the web browser, the data they contain that is required for reporting purposes is sent to the Analytics servers in the GIF Request URL via the utmcc parameter.

Cookies Set By Google Analytics

Google Analytics sets the following cookies as described in the table below. A default configuration and use of Google Analytics sets only the first 4 cookies in the table.

Name Description Expiration
__utma This cookie is typically written to the browser upon the first visit to your site from that web browser. If the cookie has been deleted by the browser operator, and the browser subsequently visits your site, a new __utma cookie is written with a different unique ID. This cookie is used to determine unique visitors to your site and it is updated with each page view. Additionally, this cookie is provided with a unique ID that Google Analytics uses to ensure both the validity and accessibility of the cookie as an extra security measure. 2 years from set/update.
__utmb This cookie is used to establish and continue a user session with your site. When a user views a page on your site, the Google Analytics code attempts to update this cookie. If it does not find the cookie, a new one is written and a new session is established. Each time a user visits a different page on your site, this cookie is updated to expire in 30 minutes, thus continuing a single session for as long as user activity continues within 30-minute intervals. This cookie expires when a user pauses on a page on your site for longer than 30 minutes. You can modify the default length of a user session with the _setSessionCookieTimeout() method. 30 minutes from set/update.
__utmc This cookie operates in conjunction with the __utmb cookie to determine whether or not to establish a new session for the user. In particular, this cookie is not provided with an expiration date, so it expires when the user exits the browser. Should a user visit your site, exit the browser and then return to your website within 30 minutes, the absence of the __utmc cookie indicates that a new session needs to be established, despite the fact that the __utmb cookie has not yet expired. Not set.
__utmz This cookie stores the type of referral used by the visitor to reach your site, whether via a direct method, a referring link, a website search, or a campaign such as an ad or an email link. It is used to calculate search engine traffic, ad campaigns and page navigation within your own site. The cookie is updated with each page view to your site. 6 months from set/update.
__utmv This cookie is not normally present in a default configuration of the tracking code. The __utmv cookie passes the information provided via the _setVar() method, which you use to create a custom user segment. This string is then passed to the Analytics servers in the GIF request URL via the utmcc parameter. This cookie is only written if you have added the _setVar() method for the tracking code on your website page. 2 years from set/update.
__utmx This cookie is used by Website Optimizer and only set when the Website Optimizer tracking code is installed and correctly configured for your pages. When the optimizer script executes, this cookie stores the variation this visitor is assigned to for each experiment, so the visitor has a consistent experience on your site.  See the Website Optimizer Help Center for more information. 2 years from set/update.

Post By Editor (2,827 Posts)

Website: →