google analytics cookies
DESCRIPTION
TRANSCRIPT
![Page 1: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/1.jpg)
Crunching Cookies without Dropping Crumbs
By Nikki Rae @analyticsgirl
![Page 2: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/2.jpg)
Nikki Rae
• Managing Director Future Insight Analytics Ltd.
• Google Analytics Specialist• First #brightonseo – 19th Feb 2010!!• @analyticsgirl
![Page 3: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/3.jpg)
Todays Session
• What is a Cookie?• How can you tell if they are working properly?• What happens if they aren't working? • What is their role in cross domain tracking?
![Page 4: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/4.jpg)
Why Do I Need to Know this?
–Many SEOs only view the Keyword report to look at• Visits to Keywords• Bounce Rate to Keywords
–How can I track keywords across sites?–How can I make sure my tracking is
working?
![Page 5: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/5.jpg)
What is a Cookie?
• Cookies are used to help Google Analytics ‘remember’ what a user has done and how they have interacted with a website.
![Page 6: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/6.jpg)
Ga.js Cookie Usage
• Which domain is being used?– Sub Domains?–Multiple Domains?
• Who is using the site?• How many times have they visited the site?• How did they get to the site?• When did a visit start/end?• Maintain visitor level custom variable information
![Page 7: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/7.jpg)
Google Analytics Cookies
• 5 Main Cookies– _utma– _utmb– _utmc– _utmz– _utmv
![Page 8: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/8.jpg)
Visitor Cookie
__utma Expires 2 years from set/update
Unique Site Visitor
1. If Cookie does not exist
a. Must be first visit
b. Cookie is set2. If cookie exists
a. Must be return visit
b. Cookie is updated every time data is sent to GA
![Page 9: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/9.jpg)
Session Cookies
__utmb Expires 30 mins from set/update
Sessions/ Visits
1. If Cookie does not exist
a. Must be a new session/visit
b. Cookie is set2. If cookie exists
a. Must be current visit
b. Cookie is updated every time data is sent to GA
![Page 10: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/10.jpg)
Session Cookies
_utmc Expires End of Browser Session
Not used in ga.js.
![Page 11: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/11.jpg)
Campaign Cookie__utmz Expires 6
months from set/update
Traffic Source
1. Source2. Medium3. Campaign
Name4. Campaign
Term
Cookie is updated every time data is sent to GA
![Page 12: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/12.jpg)
Custom Variable Cookie
__utmv 2 years from set/update
Visitor Level Custom Variable
1. Need to use _setCustomVar method
Cookie is updated every time data is sent to GA
![Page 13: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/13.jpg)
Cookies Failing?
• Pages not tracked• Traffic Sources/Mediums etc. incorrectly
recorded e.g. PPC traffic showing as organic• Cookies are device and browser based– One unique visitor per browser per device– Can misrepresent reality
![Page 14: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/14.jpg)
Testing Tracking• Download -
https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna
![Page 15: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/15.jpg)
Switch Debugger ON
• Switch it ON
![Page 16: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/16.jpg)
Find Advanced Settings
• Click ‘Show Advanced Settings’
![Page 17: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/17.jpg)
Click ‘Clear Browsing Data’
• Click ‘Clear Browsing Data’
![Page 18: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/18.jpg)
Delete Cookies
• Delete Cookies from ‘beginning of time’
![Page 19: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/19.jpg)
Go to your Site• Go to your site via any medium• Select CTRL-SHIFT-J• This is the information that would be sent to Google Analytics
![Page 20: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/20.jpg)
For Example…
• If you entered your site via a PPC Ad, and the following data appeared, you’d know it was not correctly tracked
• Most likely, not using auto-tagging or GA Manual Tagging
![Page 21: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/21.jpg)
Gif Request Parameters
![Page 22: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/22.jpg)
GA Debug.js
![Page 23: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/23.jpg)
Viewing Cookies
• Back to ‘Advanced Settings’
![Page 24: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/24.jpg)
Content Settings
• Then click ‘Content Settings’
![Page 25: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/25.jpg)
All Cookies an Site Data
• Click ‘All Cookies and Site Data’
![Page 26: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/26.jpg)
Google Analytics Cookies
![Page 27: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/27.jpg)
Identifying Unique Visitors_utma 209459845.1349019670.1365484756.1365484756.1365484756.1
1. Domain hash, unique for each domain
209459845.1349019670.1365484756.1365484756.1365484756.1
2. Unique Identifier
209459845.1349019670.1365484756.1365484756.1365484756.1
3. Timestamp for first time you visited the site
209459845.1349019670.1365484756.1365484756.1365484756.1
4. Timestamp for previous visit
209459845.1349019670.1365484756.1365484756.1365484756.1
5. Timestamp for start of current visit
209459845.1349019670.1365484756.1365484756.1365484756.1
6. Number of sessions
209459845.1349019670.1365484756.1365484756.1365484756.1
![Page 28: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/28.jpg)
First Session
In last example, the Timestamp for• 1st visit (1365484756)• Previous Visit (1365484756)• Current Visit (1365484756)
Are all the same as this is the first and only visit (number of sessions=1)
The combination of Unique ID and timestamp of first visit form a unique identifier that Google Analytics uses to identify different visitors.
![Page 29: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/29.jpg)
Session Identifiers_utmb 209459845.5.10.1365484756_utmc 209459845
1. Domain hash, unique for each domain209459845.5.10.1365484756
2. Number of Pageviews in current session209459845.5.10.1365484756
3. The 10 in the UTMB cookie starts at 10 on every site. And each time you click on an outgoing link it will count down until it reaches 0. It’s part of some outgoing links tracking system in the ga.js that never appeared in the GA interface (Andre Scholten)209459845.5.10.1365484756
4. Timestamp for current session209459845.5.10.1365484756
![Page 30: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/30.jpg)
Campaign Identifiers
![Page 31: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/31.jpg)
Campaign Identifiers_utmz 209459845.1365484756.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)
1. Domain hash, unique for each domain209459845.1365484756.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)
2. Timestamp when cookie was set209459845.1365484756.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)
3. Session Number209459845.1365484756.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)
4. Campaign Number – Number of different campaigns used to enter site209459845.1365484756.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)
5. Campaign Source209459845.1365484756.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)
6. Campaign Name209459845.1365484756.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)
7. Campaign Medium209459845.1365484756.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)
8. Campaign Terms209459845.1365484756.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)
![Page 32: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/32.jpg)
Customisation
• _setDomainName – Sets the domain to which all cookies will be set.
• _setVisitorCookieTimeout – Sets the Google Analytics visitor cookie expiration in milliseconds.
• _setSessionCookieTimeout – Sets the new session cookie timeout in milliseconds.
• _setCampaignCookieTimeout – Sets the campaign tracking cookie expiration time in milliseconds.
![Page 33: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/33.jpg)
First Party Cookies
• Can only be used by the website that sets the Cookies
• Can be overridden for sub domain and cross domain tracking
![Page 34: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/34.jpg)
Cross Domain Tracking
• www.toystore.com sets the GA Cookies• They want to be used by blog.toystore.com• They want to be used by www.bookstore.com
www.toystore.comlinker
www.bookstore.comblog.toystore.com
![Page 35: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/35.jpg)
Cross Domain Tracking
• Force GA into seeing blog.toystore.com and www.bookstore.com as the same site as www.toystore.com to share cookies
www.toystore.comlinker
www.bookstore.comblog.toystore.com
![Page 36: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/36.jpg)
Sub Domain Tracking
• Out of the box, GA sees the below as two separate domains• Use _gaq.push(['_setDomainName', 'toystore.com']);
www.toystore.com blog.toystore.com
![Page 37: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/37.jpg)
Cross Domain Tracking
• Use _gaq.push(['_setDomainName', ‘toystore.com']);_gaq.push(['_setAllowLinker', true]);
www.toystore.com
linker
www.bookstore.com
• Use Linker Method e.g. <a href="http://www.bookstore.com" onclick="_gaq.push(['_link',
'http://www.bookstore.com']); return false;">Book Store</a>
![Page 38: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/38.jpg)
Hostname Filter
• Filter Type: Custom filter > Advanced• Field A: Hostname Extract A : (.*)• Field B: Request URI• Extract: (.*)• Output To: Request URI• Constructor: $A1$B1
![Page 39: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/39.jpg)
Goal Reports etc.
• Be Careful!– Goals will also need hostname in as well as
pagename e.g. www.bookstore.com/index.php rather than just index.php
![Page 40: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/40.jpg)
Summary
• Cookies help to– Differentiate one user from another– Determine a relationship between sequential
pages– Can only be used by the website that sets them
unless you configure your tracking code– Do not collect any personal information– Can misrepresent real life (unique visitors,
deletion, unacceptance)
![Page 41: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/41.jpg)
The End
![Page 42: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/42.jpg)
References
• http://devblog.springest.com/anatomy-of-google-analytics-cookies
• http://andrescholten.net/• https://developers.google.com/analytics/devg
uides/collection/analyticsjs/cookie-usage• https://
developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite
• http://bit.ly/GATrouble
![Page 43: Google Analytics Cookies](https://reader034.vdocuments.net/reader034/viewer/2022051411/54623f47af7959aa3d8b459d/html5/thumbnails/43.jpg)
Visits/Sessions Ending?
More than 30 minutes have elapsed between pageviews for a single visitor.
At the end of a day.
When any traffic source value for the user changes. Traffic source information includes:utm_source, utm_medium, utm_term, utm_content, utm_id, utm_campaign, and gclid.As before, if any of these events occur, then the next pageview from the user will be the start of a new session.