Google & Universal Analytics Cookies – Complete Guide

 

If you want to understand how Google Analytics collect data, define users, define sessions and other metrics and/or if you want to implement cross domain tracking, cross device tracking or other specialized tracking then you need to develop good great understanding of cookies.

Index

#1 Introduction to Cookies #11 Cookie usage by ga.js (Classic Google Analytics)
#2 Types of Cookies #12 Viewing ga.js Cookies
#3 Google Analytics and Cookies #13 Unique visitor cookie (_utma)
#4 Cookie usage by analytics.js (Universal Analytics) #14 Session cookie (_utmb)
#5 Viewing analytics.js Cookies #15 Session cookie (_utmc)
#6 Cookies and Client ID #16 _utmt Cookie
#7 Cookies and User ID #17 Visitor segmentation cookie (_utmv)
#8 Attributes of _ga cookie #18 Content Experiment cookie (_utmx)
#9  Disabling analytics.js Cookies #19 Campaign cookie (_utmz)
#10 Deleting Analytics.js cookies #20 Attributes of ga.js cookies

 

Introduction to Cookies

A cookie is a text file which is used to:

  • store information about users’s preferences, location and other details.
  • protect users’ data from unauthorized access.
  • maintain certain websites’ functionality
  • serve personalize ads to users and to make advertising more effective via re-marketing.
  • collect Google Analytics data and other tracking data.

Cookies are stored on users’ hard disk and can be enabled or disabled via a web browser settings.

Note: You can not determine the exact number of users who have cookies enabled/disabled

 

Types of Cookies

There are two types of cookies:

#1 First Party Cookies – these cookies are issued by the website being visited and only the website which issued the first party cookies can read them.

#2 Third Party Cookies – these cookies are issued by the website(s) other than the website being visited.

Cookies (both first and third party cookies) be set with or without expiration date.

The cookies which are set without expiration date are known as temporary cookies. Such cookies expire as soon as you end the web session or close the browser window.

The cookies which are set with expiration date are known as persistent cookies. Such cookies expire only on the expiration date and can remain on your computer even when you have ended the web session or closed your browser window.

Note: All of the Google Analytics cookies are persistent except the _utmc cookie which is a temporary cookie.

Google set different types of cookies for different purposes.

Following are the type of cookies set by Google on a user’s hard disk:

#1 Preference cookie (called PREF) – it is used to store users’ preferences (like preferred language or any type of customization).

#2 Security cookies (like ‘SID’ and ‘HSID’) –  it is used to protect users’ data from unauthorized access.

#3 Process cookies (like ‘lbcs’) – used to maintain certain websites’ functionality

#4 Advertising cookies (like ‘id’) – used to serve personalize ads to users and to make advertising more effective

#5 Conversion cookies – used to track users’s interaction with ads.

#6 Analytics cookies (like _utma, _utmb, _ga etc) – used to collect Google Analytics data.

 

Google Analytics and Cookies

Google Analytics set cookies to:

  • Identify unique users
  • Identify unique sessions
  • Throttle the request rate
  • Store information about users’ sessions and campaigns.

Google Analytics mainly set first party cookies. But it can also set third party cookies (DoubleClick cookies), if a website is using GA display advertiser features, such as re-marketing.

GA uses cookies based on the JavaScript library being used. 

Google Analytics support three types of JavaScript libraries for tracking website usage data:

  1. urchin.js (oldest version of GA tracking code, now deprecated)
  2. ga.js (used in Classic Google Analytics)
  3. analytics.js (used in Universal Analytics)

Google Analytics Cookies are created as soon as you visit a website on which a valid Google Analytics tracking code is installed.

Since all cookies are browser specific, if you return to a website via another web browser, then Google Analytics will set different set of cookies.

If a GA cookie already exist, then it is updated for collecting users’ data. So if you try to create a cookie which already exists then in that case, it will be overwritten.

Note: Google Analytics does not store any personally identifiable information in its cookies.

 

Cookie usage by analytics.js (Universal Analytics)

The analytics.js javaScript library sets the following first party cookies:

#1  _ga cookie which is used to identify unique users and it expires after 2 years.

#2  _gat cookie which is used to throttle the request rate and it expires after 10 minutes.

The cookies are set on the top level domain so that users can be tracked across sub-domains without any extra configuration.

Understanding Top level domain

Top level domain is the highest domain level. For example, in case of the domains:

  1. www.abc.com
  2. music.abc.com
  3. asian.music.abc.com

The highest domain level is abc.com. So top level domain is abc.com

The second highest domain levels are: www.abc.com and music.abc.com

The third highest domain level is asian.music.abc.com

Note: Ideally ‘.com’ should be the highest domain level. But Google Analytics can not set up cookie at ‘.com’ level.

 

To create analytics.js cookies,  you need to create a tracking object by using the ‘create’ command.

Syntax: ga(‘create’, ‘UA-XXXX-Y’,’auto’);

Note: Universal Analytics (UA) does not really need any cookie to collect data. It can collect data even without any cookie, through the measurement protocol.

 

Viewing analytics.js Cookies

The analytics.js cookies are set as soon as a user loads your web page in his browser (provided the web page contains valid universal analytics tracking code).

In order to view the analytics.js cookies, follow the steps below:

Step-1: Visit a web page which contains valid universal analytics tracking code, in your chrome browser.

Step-2: Click the Chrome menu button on the browser toolbar and then select Settings:

chrome settings

Step-3: Scroll down the page and then at the bottom, click on the ‘Show Advanced Settings’ link:

advanced chrome settings

Step-4: Click on the ‘content settings’ button:

content settings

Step-5: Click on ‘All cookies and site data…’ button:

all cookies and site data

Step-6: Search for the domain name whose web page you visited in step-1 and then click on the ‘cookies’ text:

cookies and site data1

You can now see the various cookies set by the website, including the two analytics.js cookies: _ga and _gat:

cookies and site data2

Step-7: Click on ‘_gat‘ cookie to see more details about the cookie:

gat cookie

Step-8: Click on ‘_ga‘ cookie to see more details about the cookie:

ga cookie

From the screenshot above, we can conclude that, _ga cookie is made up of following 4 fields:

ga cookie3

First field is the version number (GA1). It seems to be fixed at the moment and may change if the cookies format changes in the future.

The second field is number of components at the domain separated by dot. By default the _ga cookie is set on the top level domain with the root level (/) path.

The third field is random unique ID (randomly generated number).

The fourth field is first time stamp i.e. the time when the cookie was first for the user or the time when a user first visit the website.

The third and fourth field together make, what we called the client ID:

ga cookie2

 

Cookies and Client ID

Google analytics identify unique users across GA sessions through client ID.

The client ID is stored in Google Analytics cookie. The GA cookie is set, when a person visit your website for the first time. Google analytics send the client ID with each hit in order to associate hits with a user.

GA cookie can exist only on the device and browser where it has been set. Since client ID is stored in a GA cookie, the client ID will also exist only on the device and browser where it has been set. Because of this reason, by default, GA can’t identify unique users across different web browsers and devices.

If you want to retrieve the client ID from _ga cookie then use the following call back function:

ga(function(tracker) {
var clientId = tracker.get(‘clientId’);
});

 

If you want to collect client IDs in GA reports then you can do that by creating a new custom dimension with user scope:

ga(‘set’, ‘dimension1’,clientId);

Identifying unique users across different web browsers and devices is known as ‘Cross Device Tracking’.

If users can login on your website then with the help of user ID, you can implement cross device tracking.

 

Cookies and User ID

User ID is a unique random number which is used to uniquely identify users across different web browsers and devices.

According to Google terms of service, the User ID must not contain any personally identifiable data like: user’s name, email address etc. User ID is different from client ID in the way, that client ID is generated by Google Analytics. Whereas, User ID is generated by your users’ authentication system (like Website Login).

To send user ID data to Google Analytics, use the ‘set’ command method like the one below:

ga(‘set’, ‘userId’, ‘USER_ID’);

here, the value of USER_ID is of type string. For example:

ga(‘set’, ‘userId’, ‘DTS234554134’});

You can also send user ID data to GA, while creating the tracking object:

ga(‘create’, ‘UA-XXXX-Y’, ‘auto’,{ ‘userId’: ‘USER_ID’ });

For example,

ga(‘create’, ‘UA-XXXX-Y’, ‘auto’,{ ‘userId’: ‘DTS234554134’});

 

There are two important points that you need to remember about using user IDs:

#1 The user ids must be set after the tracking object has been created. Otherwise the user ids will not be associated with your web property.

So following user ID set up will not work:

ga(‘set’, ‘userId’, ‘USER_ID’); // user id is set before the tracking object

ga(‘create’, ‘UA-XXXX-Y’,’auto’); // create a tracking object

The correct set up should be like the one below:

ga(‘create’, ‘UA-XXXX-Y’,’auto’); // create a tracking object
ga(‘set’, ‘userId’, ‘USER_ID’);

or

ga(‘create’, ‘UA-XXXX-Y’,’auto’,{‘userId’: ‘USER_ID’});

 

#2 The user ids must be set before you send any hit data to GA. Otherwise user ids won’t be set for all subsequent hits that occur on a page.

So following user id set up is not recommended:

ga(‘send’, ‘pageview’);

ga(‘set’, ‘userId’, ‘USER_ID’); // here user id is set after the pageview hit

The correct set up should be like the one below:

ga(‘set’, ‘userId’, ‘USER_ID’); // here user id is set before the pageview hit

ga(‘send’, ‘pageview’);

 

If you want to collect user IDs in GA reports then you can do that by creating a new custom dimension with user scope:

ga(‘set’, ‘dimension1’,userId);

Note: You can also set up user IDs for mobile apps.

 

Attributes of _ga cookie

_ga cookie has got following attributes:

  1. Cookie name
  2. Cookie domain
  3. Cookie path
  4. Cookie expires

You can modify _ga cookie, by changing its attributes.

Note: Google recommends not to directly access the _ga cookie as the cookie format might change without warning which could lead to script errors and incorrect data.

 

#1 Cookie name

Cookie name is the name of the google analytics cookie, which is _ga by default. If you want to change this cookie name to something else, you can do this by setting the cookieName field. For example:

ga(‘create’, ‘UA-12345-1’, {‘cookieName’: ‘optimizesmart’});

The cookieName field accept values of type text.

 

#2 Cookie Domain

Cookie domain is the domain at which the Google Analytics cookie _ga is set up.

By default the cookie is set on the top level domain. So, if you have set cookie at top level domain like www.optimizesmart.com then the cookie domain would be ‘optimizesmart.com’.  (without ‘www.’ Prefix).

If you want to set _ga cookie at the sub-domain level like music.optimizesmart.com then set the cookieDomain field as:

ga(‘create’, ‘UA-12345-1’, {‘cookieDomain’: ‘music.optimizesmart.com’});

If you want to set _ga cookie at the sub-sub-domain level like asian.music.optimizesmart.com then set the cookieDomain field as:

ga(‘create’, ‘UA-12345-1’, {‘cookieDomain’: ‘asian.music.optimizesmart.com’});

Note: The cookieDomain field accept values of type text.

Cookie domain needs to be ancestor of the current domain.

In case of cross domain tracking, the cookie domain needs to be ancestor of the current domain.

For example, if the current domain is www.abc.com then you can set the cookie at abc.com as abc.com is the ancestor of www.abc.com. But you can’t set cookie at music.abc.com because it is not the ancestor of www.abc.com

Similarly, you can’t set cookie at some other website like ‘example.com’ because it is not the ancestor of www.abc.com

Note: When you set an incorrect value for cookieDomain, the _ga cookie is not set.

 

Setting cookie on a local host

If you want to set _ga cookie on a local host then set the value of cookieDomain to ‘none’. For example:

ga(‘create’, ‘UA-12345-1’, {‘cookieDomain’: ‘none’});

 

Automatic cookie domain configuration

If you want google analytics to automatically determine and set the _ga cookie at the top level domain or automatically set the value of cookieDomain to ‘none’, when you use a local host then use ‘auto’ as the value of cookieDomain.

For example:

ga(‘create’, ‘UA-12345-1’, {‘cookieDomain’: ‘auto’});

You can also write this line of code as:

ga(‘create’, ‘UA-12345-1’,‘auto’);

The advantage of using automatic cookie domain configuration is that, you can track users across all sub-domains without any additional configuration.

 

#3 Cookie Path

Cookie Path is the path at which the cookie is set up.

By default the _ga cookie is set on the top level domain with the root level (/) path. If you want to modify the _ga cookie path from the default ‘/’ to say ‘/lib’ then set the ‘cookiePath‘ field to ‘/lib’:

ga(‘create’, ‘UA-XXXX-Y’, {‘cookiePath’: ‘/lib/’});

Note: Google does not recommend changing the cookie path.

 

#4 Cookie Expires

Cookie Expires is the time in seconds, after which the _ga cookie will expire.

By default _ga cookie expires after 2 years from the date it was last refreshed. Every time a new hit is sent to google analytics, the cookie is refreshed.

You can set your own cookie expiration time by using the cookieExpires field:

ga(‘create’, ‘UA-12345-21’, {‘cookieExpires’: 180});

Here we set the _ga cookie to expire after 180 seconds.

Note: The cookieExpires field accept values of type integer.

 

Making  _ga cookie a ‘browser session’ based cookie

If you set the _ga cookie to expire after 0 second then the cookie turns into a browser session based cookie and expires once the current browser session ends. For example:

ga(‘create’, ‘UA-12345-21’, {‘cookieExpires’: 0});

Note: The biggest drawback of _ga cookie is that you can’t dig out session or campaign specific data from the cookie as all of these calculations happen in the backend on GA servers.

 

Disabling analytics.js Cookies

If you want to use your own storage mechanism and send data directly to Google Analytics without using cookies then:

#1 You need to set the ‘storage’ field to none

#2 Supply your own client ID

For example,

ga(‘create’, ‘UA-XXXX-Y’, {

‘storage’: ‘none’,

‘clientId’: ‘35009a79-1a05-49d7-b876-2b884d0f825b’

});

 

Deleting Analytics.js cookies

You can delete cookies through Chrome settings:delete cookies

Once you delete the analytics.js cookies, returning users will be treated as new users.

However there is no guarantee that the returning will always be treated as new users because analytics.js does not always rely on _ga cookie for collecting data esp. when the measurement protocol is being used.

 

Cookie usage by ga.js (Classic Google Analytics)

The ga.js javaScript library sets the following first party cookies:

  1. _utma (unique visitor cookie)
  2. _utmb (session cookie)
  3. _utmc (session cookie)
  4. _utmt
  5. _utmv (visitor segmentation cookie)
  6. _utmx (Google Analytics Content Experiment cookie)
  7. _utmz (Campaign cookie)

By default, ga.js JavaScript library sets these cookies on the domain specified in the document.host browser property.

To create ga.js cookies, you need to create a tracking object:

_gaq.push([‘_setAccount’, ‘UA-XXXXX-y’]);

 

Viewing ga.js Cookies

In order to view the ga.js cookies, follow the steps below:

Step-1: Visit a web page which contains valid Classic Google Analytics tracking code, in your chrome browser.

Step-2: Follow the steps you followed earlier, for viewing the analytics.js cookies.

Step-3: Search for the domain name whose web page you visited in step-1. You can now see the various cookies set by the website, including the ga.js cookies:

 

ga js cookies

Step-4: Click on one of the ga.js cookies, to see more details about the cookie.

 

Unique visitor cookie (_utma)

This cookie is used to identify unique visitors. It expires after 2 years from the date it was last refreshed. Every time a new hit is sent to google analytics, the cookie is refreshed.

Here is how this cookie looks like:

Domain Hash => This number represents the domain which set up the cookies. All Google Analytics cookies set by a particular domain have same domain hash.

Random Unique ID => This is the second number which is randomly generated.

Timestamps => The next three numbers are timestamps which represent the time of initial visit, beginning of previous session and beginning of current session. All these three numbers also represent the number of seconds elapsed since Jan 1, 1970.

Session Counter => The last number is the session counter. It is incremented each time a visitor starts a new session.

Google analytics assign unique ID to each visitor on your website. This ID is called the visitor ID and it is made up of random unique ID and the first time stamp (also known as the time of initial visit):

If you look at the three timestamps above, you will notice that they all are same numbers which means this is your very first visit to the website.

Note: If you want to reset your session counter in _utma cookie to 1, then you can do that by deleting all of the Google Analytics cookies or by using a different web browser/device, to return to your website.

 

Session cookie (_utmb)

This cookie is used to identify a web session and to store information about the session. Google Analytics end the web session when this cookie has expired.

When your visitor loads a web page, the Google analytics tracking code check for _utmb cookie on the visitor’s hard disk. If this cookie is missing then Google Analytics treats the session as a new session and creates a new _utmb cookie. If the cookie is already present than Google Analytics update the cookie to expire in 30 minutes.

The _utmb cookie expires after 30 minutes from the date, it was last refreshed.

Every time a new hit is sent to google analytics, the cookie is refreshed. Because of this reason, a web session can last longer than 30 minutes even when _utmb cookie expires after 30 minutes. For example:

Whenever a visitor navigates to other page of a website, Google Analytics updates the _utmb cookie to expire after 30 minutes. So as long as the visitor doesn’t stay on a web page for more than 30 minutes and continue to navigate other pages of the website, the _utmb cookie will not expire and hence the web session will not terminate.

The _utmb cookie can also expire if a visitor returns to your website via a different traffic source value (utm_source, utm_medium, utm_campaign, utm_content, utm_term, utm_id or gclid), even within the 30 minutes time frame.

For example if a visitor come to your website via a PPC ad and then later return to the website via organic search listing then his second visit will start a new web session, even if 30 minutes have not elapsed between the two page views/visits.

Note: _utmb cookie does not expire if the visitor closes the browser window or navigate to other websites within the 30 minutes time frame.

Here is how this cookie looks like:

Note: The _utmb cookie expires at the end of a day.

 

Session cookie (_utmc)

The _utmc cookie is not used by ga.js any more but is still set on a user’s hard disk for interoperability with urchin.js. Historically this cookie worked along with _utmb cookie to identify a web session.

The _utmc cookie expires as soon as you close the browser window.

 

_utmt Cookie

The _utmt cookie is used to throttle the request rate and it expires after 10 minutes. It works just like _gat cookie.

 

Visitor segmentation cookie (_utmv)

This is a visitor segmentation cookie which is used by Google Analytics to identify a visitor  as male, female, member, non member, signed in or signed out visitors, pro-member, pro++ member, employee, non-employee etc.

To set this cookie you need to use the _setCustomVar() method in your Google Analytics tracking code.

Syntax: _setCustomVar(index, name, value, opt_scope)

Example: _gaq.push([‘_setCustomVar’, 1, ‘visitor-type’, ‘pro-member’, 3]);

This cookie expires after 2 years from the date it was last refreshed. Every time a new hit is sent to google analytics, the cookie is refreshed.

Here is how the _utmv cookie looks like:

From the screenshot above, we can conclude that the visitor is a pro member.

Note: _utmv cookie is set up by Google Analytics on a visitor’s hard disk, only when Google Analytics tracking code call the _setCustomVar() method and the javascript library used is ga.js.

 

Google Analytics Content Experiment cookie (_utmx)

The _utmx cookie is Google Analytics Content Experiment cookie, which is used for A/B testing of different versions of a web page.

This cookie expires after 18 months, from the date it was last refreshed. Every time a new hit is sent to google analytics, the cookie is refreshed.

 

Campaign cookie (_utmz)

It is a campaign cookie which is used by Google Analytics to store campaign information and it expires after 6 months, from the date it was last refreshed.

The campaign information is stored in campaign variables.

Following are the campaign variables supported by Google Analytics:

  1. utm_source
  2. utm_medium
  3. utm_campaign
  4. utm_term
  5. utm_content

Here is how the _utmz cookie looks like:

Domain Hash – The first number in the _utmz cookie is the domain hash which represents the website that set up the cookie on visitor’s hard disk.

Time stamp – The second number in the _utmz cookie is a timestamp.

Session Number – The third number in the _utmz cookie  is the session number which is incremented every time a visitor starts a new session. For example, from the screenshot above, we can see that this is the 8th session of a visitor.

Note: For every new session the campaign cookie values gets overwritten with new value.

Campaign number – The fourth number in the _utmz cookie is the campaign number. This number is incremented every time a visitor arrives at your website via a different campaign (even within the same session). From the screenshot above, we can conclude that the visitors arrived on the website via 6 different campaigns.

Campaign Tracking values –  The last field in the _utmz cookie, contains information about the campaign which resulted in the current visit.

utmcsr = >It represents campaign source and stores the value of utm_source variable. For example, from the screenshot above, we can conclude that the campaign source for the current visit is Google.

utmccn = >It represents campaign name and stores the value of utm_campaign variable. For example, from the screenshot above, we can conclude that the campaign name for the current visit is organic.

utmcmd = >It represents campaign medium and stores the value of utm_medium variable. For example, from the screenshot above, we can conclude that the campaign medium for the current visit is organic.

utmctr = >It represents campaign term (keyword) and stores the value of utm_term variable. For example, from the screenshot above, we can conclude that the campaign term for the current visit is seotakeaways.

utmcct = >It represents campaign content and stores the value of utm_content variable.

So in short, a visitor clicked on a search engine listing for the keyword ‘seotakeaways’ via Google Organic search.

Note: Once Google Analytics read the _utmz cookie, it sends the campaign information to the Google Analytics server which then sends the data to analytics reports.

 

Q How the content of the campaign cookie _utmz will look like if you visit the following URL:

https://www.seotakeaways.com/?utm_source=bing&utm_medium=ppc&utm_term=web-analytics&utm_content=st-brand-1&utm_campaign=brand

The campaign cookie will look like this:

Note: To see the campaign information collected by _utmz cookie in your Google Analytics reports, check the  ‘campaigns’ report under ‘Acquisition’ menu (not the Google Adwords campaigns report) in your Google Analytics account.

 

Attributes of ga.js cookies

ga.js cookies have got following attributes:

  1. _setDomainName
  2. _setCookiePath
  3. _setVisitorCookieTimeout
  4. _setSessionCookieTimeout
  5. _setCampaignCookieTimeout

You can modify ga.js cookies, by changing these attributes.

 

#1 _setDomainName()

This method is used to set the domain at which all the ga.js cookies will be set.

By default the cookie are set on the top level domain. So, if you have set cookies at top level domain like www.optimizesmart.com then the cookie domain would be ‘optimizesmart.com’.  (without ‘www.’ Prefix).

If you want to set ga.js cookies at the sub-domain level like music.optimizesmart.com then use the _setDomainName() method as shown below:

_gaq.push([‘_setDomainName’, ‘music.optimizesmart.com’]); 

If you want to set ga.js cookies at the sub-sub-domain level like asian.music.optimizesmart.com then use the _setDomainName() method as shown below:

_gaq.push([‘_setDomainName’, ‘asian.music.optimizesmart.com’]); 

 

#2 _setCookiePath()

This method is used to set the path, to which the ga.js cookies will be set.

By default the ga.js cookies are set on the top level domain with the root level (/) path. If you want to modify the cookie path from the default ‘/’ to say ‘/lib’ then use the _setCookiePath() method as shown below:

_gaq.push([‘_setCookiePath’, ‘/lib/’]);

Note: Google does not recommend changing the cookie path.

 

#3 _setVisitorCookieTimeout()

This method is used to change the expiration time of the _utma cookie. The expiration time is specified in milliseconds.

1 millisecond = 0.001 seconds

By default, _utma cookie expires after 2 years. But you can set it to expire after 1 week or any time you want to. For example:

_gaq.push([‘_setVisitorCookieTimeout’, 604800000]);

Here _setVisitorCookieTimeout() method sets _utma cookie to expire after 604800000 milliseconds or 1 week.

Note: Use a search query like ‘1 week in milliseconds’ on Google to convert any time into milliseconds.

If you want _utma cookie to expire as soon as the browser window is closed, then set the expiration timeout to 0. For e.g.

_gaq.push([‘_setVisitorCookieTimeout’, 0]);

 

#4 _setSessionCookieTimeout()

This method is used to change the expiration time of the _utmb cookie. The expiration time is specified in milliseconds.

By default, _utmb cookie expires after 30 minutes. But you can set it to expire after any time you want to. For example:

_gaq.push([‘_setSessionCookieTimeout’, 100000]);

Here you are telling Google Analytics to end a web session after 100000 milliseconds or 100 seconds.

If you want _utmb cookie to expire as soon as the browser window is closed, then set the expiration timeout of to 0. For e.g.

_gaq.push([‘_setSessionCookieTimeout’, 0]);

 

#5 _setCampaignCookieTimeout

This method is used to change the expiration time of the _utmz cookie. The expiration time is specified in milliseconds.

By default, _utmz cookie expires after 6 months. But you can set it to expire after any time you want to. For example:

_gaq.push([‘_setCampaignCookieTimeout’, 100000]);

Here you are telling Google Analytics to delete the campaign cookie (_utmz) after 100 seconds.

A 100 seconds time out means, Google Analytics will attribute conversion to a campaign for up to 100 seconds or until the campaign cookie value is overwritten with another value.

If you want _utmz cookie to expire as soon as the browser window is closed, then set the expiration timeout of to 0. For e.g.

_ gaq.push([‘_setCampaignCookieTimeout’, 0]);

Following is an example of how _setSessionCookieTimeout() and _setCampaignCookieTimeout methods can be used in your Google Analytics Tracking Code:

session-settings2


Quick announcement about my new book on Web Analytics and Conversion Optimization

The role of maths and statistics in the world of web analytics is not clear to many marketers and web analysts. Not many talk or write about the usage of statistics and data science in conversion optimization. That is why I have written this book Maths and Stats for Web Analytics and Conversion Optimization to fill this knowledge gap.

This expert guide will teach you, how to leverage the knowledge of maths and statistics in order to accurately interpret the web analytics data and take business and marketing decisions which can quickly improve the bottom-line of your online business. Read first few chapters of this book for free here.


 

Himanshu Sharma

Certified web analyst and founder of OptimizeSmart.com

My name is Himanshu Sharma and I help businesses in finding and fixing their Google Analytics and conversion issues.
  • More than ten years' experience in SEO, PPC and web analytics
  • Certified web analyst (master level) from MarketMotive.com
  • Google Analytics certified
  • Google AdWords certified
  • Nominated for Digital Analytics Association Award for Excellence
  • Bachelors degree in Internet Science
  • Founder of OptimizeSmart.com and EventEducation.com
I am also the author of the book Maths and Stats for Web Analytics and Conversion Optimization If you have any questions or comments please contact me