Firstly my apologies – this article contains more ‘geek speak’ than normal.
The subject of all this fuss is Google Analytics and the cookies it places on your website visitors’ computers. In these few words I’m going to explain the types of cookies placed and how they are updated and why, if you don’t understand the basics of this system, your Google Analytics set-up could be flawed and your reports full of false data.
OK – let’s get started with a brief introduction to cookies. They are electronic text files that are placed on your visitors’ computers by websites that need to identify these users during their website session to make the site function properly. Each cookie text file provides a specific set of information to make each website that sets them work.
Unless you have cleared or removed the cookies on your computer you may well have dozens that have been set on your machine by various websites as you have browsed your trail across the Internet. Shopping carts are a big user of cookies. Google Analytics needs them so it can see that you are a returning visitor to the website and how long you have stayed browsing. That’s the extent of the quick summary you are getting – if you need to know more, then visit Wikipedia and search under ‘HTTP Cookies’ to learn more (at http://en.wikipedia.org/wiki/HTTP_cookie).
Cookies can be set as either first-party or third-party cookies. This status relates to the match between the domain name of the web page that the website visitor was at when the cookie was set and the domain name of the cookie. First-party cookies are set to act only on the website domain shown in the address bar of the visitor. For instance, you visit www.permission.co.nz and Google Analytics sets a series of cookies that relate to it working on www.permission.co.nz.
All OK so far? Here’s where it gets a bit devious. Third-party cookies are set by domains other than those in the address bar. For instance, you visit www.sneakysite.com and a cookie is set for www.sneakyothersite.com. This sounds (and is) quite devious and, fortunately, is not something that Google Analytics does. Google Analytics only uses first-party cookies, which can cause issues when your site spans multiple domains – but more on that later.
Here’s a screenshot of them being set on my computer when visiting the Air New Zealand site, which has Google Analytics running on it.
The first cookie is called the true geek name of ’_utma’ – this is called a persistent cookie because technically it never expires. The ones I have seen are dated – in the year 2010. Repeat visits and visits to purchase are just two visitor reports that are derived from the use of this cookie.
The ‘_utmb’ and ‘_utmc’ cookies work as a pair to determine the time your visitor remains on site. The first, ‘_utmb’ is set with the exact time the visitor arrives on your site and then expires at the end of the session. Its partner, ‘_utmc’ is a session cookie that waits for 30 minutes of visitor inactivity before it fades away. The time difference between the two, less the 30 minutes, is used to work out visitor time on site.
The ‘_utmz’ cookie keeps track of where the visitor came from. For instance, if they come via a keyword search, it shows what keyword they used and on what search engine. Unless you alter the way this cookie is set, this attribution is set to expire in 6 months. So, if a prospect arrives via a keyword search on day 1 and comes back in month 3 and makes a purchase, the keyword they searched on will be credited with the sale.
The final cookie Google Analytics can set is ‘_utmv’ (not shown in the Air New Zealand example). This one is only set if the owner of the Google account that manages the website wants it to be. Like its cousin ‘_utma’, this one is a persistent cookie and can be quite handy to set if you want to segment your visitor reports into two separate groups. For instance, you may want to set this cookie after a visitor has logged into a members only area or after they have purchased from your site. This allows you to run reports to see how ‘members’ or ‘customers’ browse your website compared with others. Google has some rules over the type of data you can use when setting this cookie, mainly around the use of identifiable information in the way it is set.
OK – so what happens if the visitor decides to delete these cookies? Well, there’s nothing you can do about this. And when they come back to your website, your version of Google Analytics will treat them as a new user. Best you be aware of this fault in the system and treat your reports as providing you with a strong guide to what’s happening, rather than a totally accurate representation.
Now, once all is working well, your Google Analytics account will follow visitors as they move from your main domain to sub-domains and even across to the externally hosted shopping cart pages where, with luck, they will complete the purchase.
Has this confused you rather than clarified things? If so, then just look at the domains your website works on – if a visitor remains on the same one for all their browsing experience, then all is fine. If they move from domain to domain, then give us a call and we can talk you through your options to make your Google Analytics set-up work.