banner



Does Google Analytics Use Cookies

Final Updated: Dec 31, 2021

Table of contents for Google Analytics cookies: _ga cookie, _utmb, _gat – Tutorial

If you really desire to sympathise how Google Analytics: collect information, ascertain users, define sessions, define metrics and/or if you want to implement cross-domain tracking, cross-device tracking or any other specialized tracking in GA so you need to develop a good great understanding of cookies.

Introduction to Cookies

A cookie is a text file that is used to:

  • Store information nearly users' preferences, users' location, and other details
  • Protect users' data from unauthorized access
  • Maintain certain websites' functionality
  • Serve personalize ads to users and brand advert more effective via re-marketing
  • Collect Google Analytics data and other tracking information.

Cookies are stored on a user's hard disk and tin can exist enabled or disabled via web browser settings.

Cookies are nothing but a piece of lawmaking that is saved by the websites onto the user's web browsers when a session is initiated. They have a lot of uses which are mentioned above just the most important ones are session management, user personalization, and tracking

Cookies are not programs, they exercise non perform any function. For example, if a user visits a website, and then the cookie of that website is dropped on the user'due south browser. Now, when the users visit the website over again later on a few days, the website will know that it was the same user.

With the European union cookie policy in place, every website owner must at present seek the consent of the user earlier dropping any cookies in their browser. Users have all the rights to opt-in or opt-out of the cookies and they also accept the capability of opting out of specific cookies likewise (For example, opting out of marketing cookies).

Note: You lot cannot decide the verbal number of users who have cookies enabled/disabled.

Types of Cookies

There are two types of cookies:

  1. Beginning-Party Cookies – These cookies are issued past the website being visited and but the website which issued the first-political party cookies can read them. The data collected by these cookies is used mainly for calculating sessions, pageviews, bounce rate and other metrics.

    Every bit an example of the first party cookie, when a user signs into an ecommerce website the spider web browser will send a asking in a procedure that provides the highest level of trust that the user is directly interacting with the principal website. The website drops a cookie into the user'due south browser nether the aforementioned domain name.

  2. Third-Party Cookies – These cookies are issued by the website(south) other than the website existence visited.

    For example, say you have visited an online shopping website and spend some fourth dimension on the product purchase page and did not make a buy. Afterwards, y'all would receive emails near a price drop for the same product that you lot looked at. These are shown to the user by remarking pixels placed on the page.

Cookies With and Without Expiration Engagement

Cookies (both first and 3rd-political party cookies) can be set with or without an expiration date.

The cookies which are fix without an expiration date are known every bit temporary cookies . Such cookies expire as shortly as you finish the spider web session or close the browser window.

The cookies which are set with an expiration date are known equally persistent cookies . Such cookies expire merely on the expiration engagement and can remain on your figurer even when you lot take ended the web session or closed your browser window.

Autonomously from this, you as well have secure cookies. Only an HTTPS website can set up these cookies. Information technology is mostly ecommerce websites with checkout pages that redirect to payment gateways that accept secure cookies in order to make transactions prophylactic and secure. Cyberbanking websites also use secure cookies.

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

Cookies Ready By Google

Google set up different types of cookies for different purposes.

Following are the type of cookies fix by Google on a user's hard disk:

  • Preference cookie (called PREF ) – it is used to shop users' preferences (like preferred language or any type of customization).
  • Security cookies (like ' SID ' and ' HSID ') –  it is used to protect users' information from unauthorized access.
  • Process cookies (like ' lbcs ') – used to maintain certain websites' functionality
  • Advertising cookies (like ' id ') – used to serve personalized ads to users and to brand advertisement more than effective
  • Conversion cookies – used to track users' interaction with ads.
  • 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 well-nigh users' sessions and campaigns.

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

Cookies and JavaScript Libraries

Google Analytics uses cookies based on the JavaScript library being used.

Google Analytics has got iii types of JavaScript libraries for tracking website usage data:

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

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

Since all cookies are browser-specific, if you render to a website via another web browser then Google Analytics will set a different prepare of cookies. If a GA cookie already exists, then it is updated for collecting users' data. And so if you endeavour to create a cookie that already exists then in that case, it volition be overwritten.

Annotation: Google Analytics does not store and does not allow, any personally identifiable information in its cookies.

analytics.js Cookies (Cookies used by Universal Analytics)

The analytics.js JavaScript library sets the following kickoff-party cookies:

#i _ga cookie which is used to identify unique users and expires subsequently two years.

#2 _gat cookie which is used to throttle the request charge per unit and information technology expires later on one infinitesimal.If Google Analytics is set upwards using GTM, then this cookie is fix as  _dc_gtm_<property-id>.

#3 _gid which is used to identify the user and expires in 24 hours

These cookies are set on the top-level domain so that users tin exist automatically tracked across subdomains without whatever extra configuration.

Understanding Top-Level Domains

The acme-level domain is the highest domain level.

For example, in the case of the following domains:

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

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

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

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

Annotation : Ideally '.com' should be the highest domain level. But Google Analytics can not prepare a cookie at '.com' level.

Creating analytics.js Cookies

To create analytics.js cookies,  y'all need to create a tracking object by using the 'create' command.

Syntax: ga('create', 'UA-XXXX-Y','machine');

Note: Universal Analytics (UA) tin can also collect data even without whatsoever cookie, through the measurement protocol.

Viewing analytics.js Cookies

The analytics.js cookies are set equally soon as a user loads your web page in his browser (provided the web page contains valid universal analytics tracking code and information technology fires on folio load).

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

Stride-i: Visit a web page that contains valid universal analytics tracking code, in your Chrome browser.

Footstep-two: Click the Chrome menu button on the browser toolbar and then select Settings:

ga cookies chrome settings

Step-three: Scroll downward the page and then at the lesser, click on the 'Advanced' drop-down menu:

ga cookies advanced settings

Step-iv: Click on the 'content settings' button:

ga cookies content settings

Step-5: Click on 'Cookies' button:

ga cookies cookies button

Step-6: Coil down the page and search for 'Search Cookies' text box:

ga cookies search cookies search

Stride-7: Search for the domain name whose web page you visited in pace-one and and then click on the push button like the one beneath:

ga cookies all cookies and site data 1

You can at present come across the various cookies set up by the website, including the analytics.js cookie_ga:

ga cookies cookies set by domain

Pace-viii: Click on '_ga' cookie to run into more details near the cookie:

ga cookies click ga cookie 1

You tin can at present see all the details nigh _ga cookie:

ga cookies ga cookies detail 1

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

ga cookies ga cookie3

Kickoff field is the version number (GA1). Information technology seems to be fixed at the moment and may alter if the cookies format changes in the futurity.

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

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

The fourth field is get-go time stamp i.eastward. the time when the cookie was kickoff for the user or the time when a user first visit the website.

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

ga cookies ga cookie2

Cookies and Client ID

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

The client ID is stored in the Google Analytics cookie. The GA cookie is set, when a person visits your website for the first time. Google Analytics sends the customer ID with each hit in club to associate hits with a user.

A 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 prepare. Because of this reason, by default, GA can't identify unique users beyond different spider web browsers and devices.

Also, annotation that cookies are site-specific. The default Google Analytics implementation will track the subdomain user'due south activity. If a user travels between the site and the subdomain they will still maintain the aforementioned cookie. However, cross-domain tracking is dissimilar, cookies will not be shared unless you have set up cantankerous-domain tracking correctly on your website.

If y'all want to retrieve the client ID from _ga cookie then use the post-obit call back role :

ga(part(tracker) {
var clientId = tracker.become('clientId');
});

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

ga('gear up', 'dimension1',clientId);

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

If users tin log in on your website then with the help of user ID , you lot can implement cross-device tracking.

Cookies and User ID

User ID is a unique random number that is used to uniquely place users beyond different web browsers and devices.

Co-ordinate to Google terms of service, the User ID must non incorporate any personally identifiable data like the user's name, e-mail address, etc. User ID is unlike 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, utilize the 'prepare' control method like the ane below:

ga('set up', 'userId', 'USER_ID');

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

ga('fix', 'userId', 'DTS234554134'});

You can as well ship user ID data to GA, while creating the tracking object:

ga('create', 'UA-XXXX-Y', 'machine',{ 'userId': 'USER_ID' });

For example,

ga('create', 'UA-XXXX-Y', 'motorcar',{ 'userId': 'DTS234554134'});

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

#one The user ids must be set subsequently the tracking object has been created. Otherwise, the user IDs will not exist associated with your spider web holding.

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 gear up should be like the one below:

ga('create', 'UA-XXXX-Y','auto'); // create a tracking object
ga('ready', 'userId', 'USER_ID');

or

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

#ii The user ids must be set up earlier yous send any hitting data to GA. Otherwise, user IDs won't be fix for all subsequent hits that occur on a page.

So the post-obit user ID fix is not recommended:

ga('send', 'pageview');

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

The correct set should exist similar the one below:

ga('prepare', 'userId', 'USER_ID'); // here user id is set earlier the pageview hit

ga('transport', 'pageview');

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

ga('set up', 'dimension1',userId);

Note: Y'all tin also prepare user IDs for mobile apps.

_ga cookie has got the following attributes:

  1. Cookie proper noun
  2. Cookie domain
  3. Cookie path
  4. Cookie expires

Y'all can alter _ga cookie, past changing its attributes.

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

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

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

The cookieName field accepts values of type text.

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

Past default, the cookie is set up on the elevation-level domain. So, if you have set a cookie at the top-level domain like world wide web.optimizesmart.com then the cookie domain would exist 'optimizesmart.com'.  (without 'www.' Prefix).

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

ga('create', 'UA-12345-one', {'cookieDomain': 'music.optimizesmart.com'});

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

ga('create', 'UA-12345-i', {'cookieDomain': 'asian.music.optimizesmart.com'});

Annotation: The cookieDomain field accepts values of type text.

Cookie domain needs to exist an ancestor of the current domain.

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

For case, if the current domain is www.abc.com and then yous can set the cookie at abc.com as abc.com is the ancestor of www.abc.com. Just you can't set a cookie at music.abc.com because it is not the ancestor of www.abc.com

Similarly, yous can't set a cookie on some other website like 'example.com' considering it is not the ancestor of world wide web.abc.com

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

Setting cookie on a local host

If you want to gear up _ga cookie on a local host and so set the value of cookieDomain to 'none'. For example:

ga('create', 'UA-12345-ane', {'cookieDomain': 'none'});

Automatic cookie domain configuration

If yous 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 utilize a local host then employ 'auto' as the value of cookieDomain.

For example:

ga('create', 'UA-12345-1', {'cookieDomain': 'machine'});

You lot tin also write this line of code as:

ga('create', 'UA-12345-ane','car');

The advantage of using an automatic cookie domain configuration is that you tin rails users across all sub-domains without any additional configuration.

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

By default, the _ga cookie is set on the tiptop-level domain with the root level (/) path. If you desire to change the _ga cookie path from the default '/' to say '/lib' then set up the 'cookiePath' field to '/lib':

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

Note: Google does non recommend changing the cookie path.

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

By default, a _ga cookie expires afterwards ii 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 fourth dimension by using the cookieExpires field:

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

Hither nosotros ready the _ga cookie to expire later on 180 seconds.

Notation: The cookieExpires field accepts values of type integer.

Making  _ga cookie a 'browser session' based cookie

If you fix the _ga cookie to expire afterwards 0 seconds 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 y'all tin't dig out session or campaign-specific data from the cookie every bit 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 ship data direct to Google Analytics without using cookies and so:

#i You need to ready the 'storage' field to none

#two Supply your own client ID

For instance,

ga('create', 'UA-XXXX-Y', {

'storage': 'none',

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

});

Deleting analytics.js Cookies

ga cookies delete cookies 1

You tin can delete cookies through Chrome settings:

One time you delete the analytics.js cookies, returning users will be treated equally new users.

Nevertheless, at that place is no guarantee that the returning will always be treated every bit new users because analytics.js does not always rely on _ga cookie for collecting data esp. when the measurement protocol is being used.

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 (company segmentation cookie)
  6. _utmx (Google Analytics Content Experiment cookie)
  7. _utmz (Entrada cookie)

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

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

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

Viewing ga.js Cookies

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

Step-1: Visit a web page that contains valid Archetype Google Analytics tracking lawmaking, in your chrome browser.

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

Footstep-3: Search for the domain name whose web page you lot visited in footstep-1. You tin can now come across the various cookies gear up by the website, including the ga.js cookies:

ga cookies ga js cookies 1

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

This cookie is used to identify unique visitors. Information technology expires ii years from the engagement it was concluding refreshed. Every time a new hit is sent to Google Analytics, the cookie is refreshed.

It is a persistent cookie, which means it remains on the user's browser until it expires or the user clears the enshroud.

This cookie generates the client ID for the unique user. For example, if a user visited your website on March fifteenth this cookie will fix a customer ID in their browser. When the user returns to the website, say on March 20thursday, GA will look for this cookie. If this cookie already exists and so it understands that it is a returning company to the site.

In add-on to assigning a unique identification to each of your visitors, the __utma cookie records the time and date of the outset visit, the total number of visits, and the first time of the current visit.

Hither is how this cookie looks like:

ga cookies utma cookie

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

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

Timestamps => The next 3 numbers are timestamps which represent the fourth dimension of initial visit , beginning of previous session and outset of electric current session . All these three numbers also represent the number of seconds elapsed since Jan ane, 1970.

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

Google analytics assign a unique ID to each visitor on your website. This ID is called the visitor ID and information technology is fabricated up of random unique ID and the first timestamp (too known as the time of initial visit):

ga cookies utma cookie2

If y'all wait at the three timestamps above, you will discover that they all are the aforementioned numbers which means that this is your very first visit to the website.

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

This cookie is used to identify a web session and to shop information about the session. Google Analytics ends the web session when this cookie has expired. This cookie basically records the number of page views visited by the user in that session and also captures the start fourth dimension of each visit.

When your company loads a spider web folio, the Google Analytics tracking code checks for _utmb cookie on the company's hd. If this cookie is missing so Google Analytics treats the session equally a new session and creates a new _utmb cookie. If the cookie is already present than Google Analytics updates the cookie to expire in 30 minutes.

The _utmb cookie expires after xxx minutes from the engagement, information technology was last refreshed.

Every time a new hitting is sent to google analytics, the cookie is refreshed. Because of this reason, a web session can concluding longer than 30 minutes fifty-fifty when _utmb cookie expires after xxx minutes. For case:

Whenever a company navigates to another folio of a website, Google Analytics updates the _utmb cookie to expire after 30 minutes. And so as long as the company doesn't stay on a spider web page for more than thirty minutes and continues 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 elapse if a visitor returns to your website via a dissimilar traffic source value (utm_source, utm_medium, utm_campaign, utm_content, utm_term, utm_id or gclid), fifty-fifty within the 30 minutes fourth dimension frame.

For example, if a visitor comes to your website via a PPC advert and then later return to the website via organic search list and then his 2nd visit will start a new web session, even if 30 minutes take not elapsed between the 2 page views/visits.

Note: _utmb cookie does not expire if the company closes the browser window or navigate to other websites inside the 30 minutes fourth dimension frame.

Here is how this cookie looks like:

ga cookies utmb cookie

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

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

The_utmb cookie basically captures the exact arrival time of the user on the website and the _utmc cookie registers the exit time of the user. This cookie gives you data about how visitors have accessed your website, have they entered the URL of your website direct into your browser or accept they clicked on whatsoever link somewhere on your site?

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

The _utmt cookie is used to throttle the request rate and it expires later 10 minutes. It works merely similar_gat cookie.

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

To prepare this cookie y'all need to use the _setCustomVar() method in your Google Analytics tracking code.

Syntax: _setCustomVar(index, proper noun, value, opt_scope)

Example: _gaq.button(['_setCustomVar', one, 'visitor-type', 'pro-member', 3]);

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

Here is how the _utmv cookie looks like:

ga cookies utmv cookie

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

Note: _utmv cookie is set by Google Analytics on a company'southward hard disk, just when Google Analytics tracking code telephone call the _setCustomVar() method and the javascript library used is ga.js.

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

This cookie expires afterward 18 months, from the appointment it was concluding refreshed. Every time a new striking is sent to google analytics, the cookie is refreshed.

This is a entrada cookie that is used past Google Analytics to store campaign data and it expires afterwards six months, from the appointment information technology was last refreshed.

This cookie captures the HTTP referrer and notes where the visitor has arrived from with the referrer information (cpc, organic, direct, social) and as well information technology captures what keyword has generated the visit, including the geolocation.

The campaign information is stored in campaign variables.

Post-obit 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:

ga cookies utmz cookie

Domain Hash – The starting time number in the _utmz cookie is the domain hash which represents the website that sets up the cookie on the visitor's hard deejay.

Timestamp – The 2d 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 higher up, nosotros can see that this is the 8th session of a visitor.

Annotation: For every new session the campaign cookie values get overwritten with the new value.

Campaign number – The 4th number in the _utmz cookie is the campaign number. This number is incremented every fourth dimension a visitor arrives at your website via a unlike entrada (even inside the same session). From the screenshot above, nosotros 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 entrada which resulted in the electric current visit.

utmcsr = >It represents campaign source and stores the value of utm_source variable. For example, from the screenshot in a higher place, we tin conclude that the entrada source for the current visit is Google.

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

utmcmd = >Information technology represents campaign medium and stores the value of utm_medium variable. For example, from the screenshot in a higher place, we tin 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 case, from the screenshot to a higher place, 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.

And so in curt, a visitor clicked on a search engine listing for the keyword 'seotakeaways' via Google Organic search.

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

This cookie lasts "forever". Information technology is a persistent cookie. It is used for segmentation, data experimentation and  _utmv works manus in hand with the   __utmz cookie to ameliorate cookie targeting capabilities.

Q How the content of the campaign cookie _utmz will expect like if yous visit the following URL:

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

The campaign cookie will look like this:

ga cookies utmz cookie2

Note: To meet the campaign data collected past _utmz cookie in your Google Analytics reports, cheque the  'campaigns' report under the 'Acquisition' bill of fare (not the Google Adwords campaigns written report) in your Google Analytics account.

Attributes of ga.js Cookies

ga.js cookies have got the post-obit attributes:

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

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

#1_setDomainName()

This method is used to prepare the domain at which all the ga.js cookies volition exist set.

By default, the cookie is set on the top-level domain. And then, if you take set cookies at height-level domain like www.optimizesmart.com then the cookie domain would be 'optimizesmart.com'.  (without 'www.' Prefix).

If you want to gear up ga.js cookies at the sub-domain level similar music.optimizesmart.com then use the_setDomainName() method equally shown below:

_gaq.push button(['_setDomainName', 'music.optimizesmart.com']);

If you desire to fix ga.js cookies at the sub-sub-domain level similar asian.music.optimizesmart.com then apply the_setDomainName() method as shown beneath:

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

#ii _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 assault the top-level domain with the root level (/) path. If you lot want to change the cookie path from the default '/' to say '/lib' and so use the _setCookiePath() method equally shown below:

_gaq.button(['_setCookiePath', '/lib/']);

Annotation: 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

Past default, _utma cookie expires afterwards ii years. Merely you tin can prepare it to expire after 1 week or any time you desire to. For example:

_gaq.push(['_setVisitorCookieTimeout', 604800000]);

Here _setVisitorCookieTimeout() method sets _utma cookie to expire afterwards 604800000 milliseconds or ane week.

Notation: Apply a search query similar '1 week in milliseconds' on Google to convert any time into milliseconds.

If yous 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 fourth dimension is specified in milliseconds.

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

_gaq.button(['_setSessionCookieTimeout', 100000]);

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

If you desire _utmb cookie to expire as soon every bit the browser window is airtight, then gear up the expiration timeout of to 0. For e.chiliad.

_gaq.button(['_setSessionCookieTimeout', 0]);

#5 _setCampaignCookieTimeout

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

Past default, _utmz cookie expires after half dozen months. But you can set it to elapse subsequently any time you want to. For case:

_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 entrada for up to 100 seconds or until the entrada cookie value is overwritten with another value.

If you lot want _utmz cookie to elapse equally shortly as the browser window is closed, then prepare the expiration timeout of to 0. For e.g.

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

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

ga cookies session settings2
  1. Cross Domain Tracking in Google Analytics – Complete Guide
  2. How to cheque cross-domain tracking in Google Analytics
  3. Google Analytics Subdomain Tracking Tutorial
  4. Cantankerous Domain Tracking with Google Tag Manager (GTM)
  5. Cross Domain Tracking in GA4 (Google Analytics four) Setup Guide
  6. Setting up Sales Funnel across websites in Google Analytics
  7. Google Analytics GDPR checklist. Become GDPR compliant using GA
  8. Track the Impact of Google Analytics Cookie Consent on Website Traffic.

Often Asked Questions About Google and Universal Analytics Cookies Tutorial?

What is a cookie?

A cookie is atext file which is used to:

– Store data about users' preferences, users' location, and other details
– Protect users' data from unauthorized access
– Maintain certain websites' functionality
– Serve personalize ads to users and to make advertising more than effective via re-marketing
– Collect Google Analytics data and other tracking information.

Where are cookies stored?

Cookies are stored on a user's hard deejay and tin be enabled or disabled via web browser settings.

What types of cookie are there?

There are 2 types of cookies:
First-Political party Cookies – These cookies are issued by the website being visited and only the website which issued the showtime-party cookies tin can read them.
Tertiary-Party Cookies – These cookies are issued by the website(south) other than the website being visited.

Practice all cookies have an expiration date?

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

The cookies which are gear up without expiration engagement are known every bittemporary cookies. Such cookies expire as soon equally you lot finish the spider web session or shut the browser window.

The cookies which are set with an expiration date are known every bit
persistent cookies. Such cookies expire merely on the expiration date and can remain on your computer fifty-fifty when y'all have ended the web session or airtight your browser window.

When are Google Analytics cookies created?

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

Since all cookies are browser-specific, if you lot return to a website via another web browser then Google Analytics volition set a unlike prepare of cookies. If a GA cookie already exists, so information technology is updated for collecting users' data. And so if you attempt to create a cookie which already exists and so in that instance, it volition be overwritten.

#one Why digital analytics is the key to online business success.

​#ii The number 1 reason why most marketers are not able to calibration their advert and maximize sales.

#iii Why Google and Facebook ads don't work for virtually businesses & how to make them work.

#4 ​Why you won't get any competitive advantage in the market but past knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your concern.

#six How to advertise on any marketing platform for Gratis with an unlimited budget.

​#7 How to acquire and principal digital analytics and conversion optimization in record time.

Does Google Analytics Use Cookies,

Source: https://www.optimizesmart.com/google-analytics-cookies-ultimate-guide/

Posted by: hargravesyounter1970.blogspot.com

0 Response to "Does Google Analytics Use Cookies"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel