Cookies in Google Analytics

Cookies form the foundation of Google Analytics reports. A warm, delicious foundation.
Cookies are at the heart of Google Analytics. Not just because they are delicious, but because they provide a critical link in tracking individual visitors and visits.
There is shockingly little documentation on the cookies created by the tracking code, what they store or how they work. Because they are so integral to the Google Analytics reports, it is important to lift the hood and understand exactly what is going on.
Flavors
First, to dispel some confusion. Cookies are widely used across the wide expanse of the Internets. You probably have hundreds of cookies stored on your computer right now. They are small text files stored by the browser and can only be read by the website that created them. Cookies are browser-specific. In other words, if you are using multiple browsers on a computer, they will each have their own set of cookies.
If I am visiting www.mysite.com, and it sets cookies on my machine, those are first-party cookies. If, however, a third-party script from www.ads_world.com sets cookies on my machine, these are third-party cookies. The difference is in which domain the cookies are tied to, and therefore, which domain can read them.
Google Analytics uses first-party cookies. One primary reason for this is that third-party cookies are often blocked by browsers. It does this by setting cookies with code that is called on your site, the _trackPageview() method.
Cookies come in two more flavors: session and persistent. Session cookies have no set expiration date. They are deleted from memory when the browser closes. Persistent cookies have a defined expiration date. The browser will only delete them when they expire.
How Google Analytics Uses Cookies
Google Analytics relies heavily on cookies. Using cookies allows Google Analytics to be much more precise in its measurements. If a visitor deletes or blocks their cookies, information for that visit or visitor will be misinterpreted or lost.
Unique Visitors
Cookies allow for unique visitor tracking. They tie all the activity of a visitor into a single visit. They are used to determine when a visit ends.
Activity
Cookies store vital information about each visit. They store the start time of the current visit and keep track of how many pages have been viewed so far. If a visitor closes his browser or is inactive for too long, the cookies will report that the visit ended.
Cookies store the date and time of the visitor's first visit (allowing for calculations of how many visits it took to convert). The total number of visits from the visitor is stored in cookies, too.
Traffic Source
Cookies are the main vehicle for attributing visit information and conversions to specific marketing campaigns or traffic sources. Each time the visitor comes to the site, the code stores new traffic source information (if there is any) in the visitor's cookies.
Dissecting Google Analytics Cookies
Google Analytics uses several cookies to record all of this information. The most common are covered here. The expiration dates for each cookie may be customized with built-in GA code.
All of the cookies store a domain hash that ties them to the same site. In the case that cookie information changes during a visit (e.g., a user-defined variable gets changed from "Prospect" to "Customer"), Google Analytics will attribute the entire visit to the last cookie value.
The __utma cookie is a persistent cookie that expires in two years. With each new visit, the expiration date is refreshed.
The expiration time can be customized for each site. Our code generator tool can automatically customize that code.
The __utmb cookie is a persistent cookie that expires in 30 minutes. Each pageview refreshes it.
The expiration time can be customized for each site (or page). Our code generator tool can automatically customize that code.
This is a persistent cookie with a catch: it expires in six months and is only refreshed when the traffic source changes. Every other cookie is refreshed with each pageview. The impact of this is that a banner ad that brings a visitor to your site will get the credit for all future direct visits for up to six months. After six months, if there have not been visits from any other source, the cookie will expire and start to attribute information to direct visits.
The six-month window can be customized for each site. The code generator tool does this automatically.
Sending it to Google Analytics
Finally, all of this cookie information is sent to Google Analytics via the __utm.gif request that it makes with each pageview. These cookie values are all tacked onto a ridiculously long query string, where they will show up in log files. When Google Analytics processes its log files, it relies on this cookie information (among other pieces of data in the query string) to populate your reports.













Comments
Unique Visitor Count Changes, why?!
I'd like to know why my unique visitor count seems to change. For example, I captured a screenshot of my monthly report on the last day of the month and yet today when I logged in, I noticed it says less than what I previously captured. This has happened several times. I imagine it has something to do with the cookies. Sometimes, I see a diff. number in the morning when I check it and then a lower number for the daily unique count by day's end. WHY?! It's mind boggling!
Re: Changing unique visitor counts
Some metrics in Google Analytics, like unique visitors, are processed several times throughout the day. When you look at reports that include today, you will see data on visits that haven't been finished yet, or on visitors that may have made multiple visits to your site. Some of these calculations are made less frequently throughout the day, so they can fluctuate.
Reports that are at least 24 hours old shouldn't change at all.
Google Analytics Cookies
What is the exact process to make google analytics code to count each visit from my browser.
when i visit my website 100 times a day from same IP, same computer, same browser then everyone knows that google will not count and display 100 visits in google analytics report, Now what i want to see is all 100 visits count in GA reports.
Got my point?
Hoping needfull solution for experts.
Showing individual visits
If you want each of your visits to count as an individual visit, you must either close your browser or wait 30 minutes. If you leave your browser open and visit your site within 30 minutes, it will show as the continuation of a previous visit, not a new visit.
The other option is to delete your cookies. Then Google Analytics will see your next pageview as the beginning of a new visit.
I'm not clear on why you would want to do that, though....