Wednesday, February 26, 2014

Cookies used by Google Analytics - Part 2 - _Utma Cookie





 Now that we have some idea about cookies in general and there types i.e. First Party Cookies or Third Party cookies. Let’s dig deeper and try to understand how cookies used by google analytics work and how google analytics extracts information from them.

The Cookies used by google analytics are all first party and Persistent (permanent) cookies. Lets understand something about _utma cookie.

1.  _utma Cookie:  This Cookie is primarily used to identify the users  accessing your website. If you are visiting the website for the first time, it will create a  _utma cookie else it will update it, every time you happen to visit the web site. The validity of this cookie is 2 years from last updating or creation. If anyone has confusion whether the cookie is a first party cookie or the third party cookie just tally the domain name with the website you visited. They should match each other. If not, then it is a third party cookie. Now let me show you how google analytics extract information from this cookie in the first place.
Below is the structure of a _utma cookie. The content field is divided into 5 parts. 

a.) Domain Hash: The number 223957632  refers to the domain value of the website visited. It is domain specific and will remain constant every time you make a visit to the website.

b.) Visitor Id : The visitor id is a combination of second number: 397979052 and the third number 1393393671  which makes it unique.  The second number is a random unique id generated when you first visit the website or when you have deleted the earlier cookie file.

c.) Initial Visit: This third number 1393393671 is the time when the first visit was made to the website or when the website was visited after deleting the cookie file.The numbers are actually seconds since January 1st 1970 measured in UNIX time.

d.) Previous session: The Number 1393393671 denotes the time stamp when the website was last visited.

e.) Current Session: The Number 1393393671 denotes the time stamp of the current visit.

f.) Session Counter: The Number 1 represents the number of times this website was visited. Now, since this was my first visit the counter is 1.

To understand this more clearly please find below sample of cookies created/updated during my visit to the website.

Name:
__utma
Content:
223957632.397979052.1393393671.1393393671.1393393671.1
Domain:
.jindal.utdallas.edu
Path:
/
Send for:
Any kind of connection
Accessible to script:
Yes
Created:
Tuesday, February 25, 2014 11:50:56 PM
Expires:
Thursday, February 25, 2016 11:50:56 PM











Do check the difference in the values of previous visit, current visit and session counter field.



Name:
__utma
Content:
223957632.397979052.1393393671.1393393671.1393446186.2
Domain:
.jindal.utdallas.edu
Path:
/
Send for:
Any kind of connection
Accessible to script:
Yes
Created:
Wednesday, February 26, 2014 2:23:05 PM
Expires:
Friday, February 26, 2016 2:23:05 PM


















































































































References:

cookie-usage. (2014, October 3). Retrieved from developers.google.com: https://developers.google.com/analytics/devguides/collection/analyticsjs/cookie-usage
Holloway, G. (2013, Jun 20). Google Analytics and Cookies – The Complete Guide. Retrieved from www.koozai.com: http://www.koozai.com/blog/analytics/google-analytics-and-cookies/
Path, C. (2010, August 31). GA-Basics-The-Structure-of-Cookie-Values/. Retrieved from http://www.cardinalpath.com: http://blog.vkistudios.com/index.cfm/2010/8/31/GA-Basics-The-Structure-of-Cookie-Values
Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License













No comments:

Post a Comment