Google Analytics Cookie Consent
Do you need user consent to enable Google Analytics? The answer is yes, AND no! It depends on a number of factors and a good dose of personal opinion.
Firstly, we need to consider that both the GDPR and the ePrivacy Directive implementations are in play here. So we have GDPR regulating anything involving the processing of personal data. And we have each country’s implementation of the 2009 ePrivacy Directive (ePD), e.g. in the UK the PECR, providing the rules on electronic communications whether there is personal data involved or not. So that’s one GDPR and 28 ePrivacy sets of rules – one for each EU country. Admittedly most of the ePD implementations are similar, but how they are interpreted by each regulator, and more importantly, how they are enforced by each regulator are key factors to consider. If you have a service that has users across the EU then think broad and start with the source – the ePD.
The need for consent for cookies and similar technologies is a generally held principle within the ePD, but there are exemptions noted. The ePD states in Article 5.3:
Member States shall ensure that the storing of information, or the gaining of access to information already stored, in the terminal equipment of a subscriber or user is only allowed on condition that the subscriber or user concerned has given his or her consent, having been provided with clear and comprehensive information, in accordance with Directive 95/46/EC, inter alia, about the purposes of the processing. This shall not prevent any technical storage or access for the sole purpose of carrying out the transmission of a communication over an electronic communications network, or as strictly necessary in order for the provider of an information society service explicitly requested by the subscriber or user to provide the service.DIRECTIVE 2002/58/EC OF THE EUROPEAN PARLIAMENT AND OF THE COUNCIL of 12 July 2002 (updated in 2009) – Article 5.3
So what does this mean in the real world, especially for a piece of technology ten years later? Let’s start with looking at the mechanics of Google Analytics.
Google Analytics – A Summary
Google Analytics (GA) is Google’s SaaS product for collecting, storing and analysing web traffic data to help you understand how people are using your website. You load a tracker script onto your webpage and this sends information, such as which links you click on, directly back to Google. Google states that it acts as a data processor for GA – acting on behalf of the website (the data controller). In turn, Google has no rights over that data to use it for other Google purposes, such as advertising or tracking across other services.
Is Google Really a Data Processor?
If you read Google’s terms and documentation, it clearly states that it is indeed a data processor. The more cynical amongst us might find that hard to believe in light of privacy compliance violations as determined by the likes of the CNIL. Many do not trust Google and believe that they will use your data for other purposes without your permission.
Your opinion on this is important, since if you think that Google cannot be trusted to act solely under your instruction then you must not treat Google as a data processor. If however you take Google on their word and find no evidence to the contrary then Google is your data processor for GA.
This is important as the data processor designation opens GA up to potentially not needing consent.
Since we’re here to focus on the rules and what contractual terms we have on paper, let’s assume that Google is indeed a data processor when providing GA.
Personal Data or Not?
GA is a very impressive product and can track a lot of information, from IP addresses and browsing clicks to recording form entries and analysing marketing campaign success. Here you need to decide if you want to take a cautious road and put it into an “anonymous” mode or go all out and collect user identifiable data. If you go with anonymous, you have the ability to not need consent.
In 2012 the WP29 (think data protection referee association of the EU pre-GDPR) produced a document “Opinion 04/2012 on Cookie Consent Exemption” to discuss what cookies, services and scenarios required consent and which could have an exemption to consent. Most things fell into one camp or another (consent needed or no consent needed), but one outlier was the mention of “First Party Analytics” in section 4.3. By “First Party”, the WP29 mean something very different to what 99% of us think of as first party. They mean (as described in section 2.3) the website or a party acting on its behalf (e.g. a data processor). So GA would count as a first party here.
To restate this, the WP29 opinion here is that you can have Google Analytics enabled by default, without the need for consent as long as you:
- Provide an opt-out (e.g. pre-ticked tickbox with the ability to untick it).
- Anonymise the data sent to Google from the web browser.
- Are happy that Google is acting as a data processor.
The more technical amongst you will wonder how any anonymisation can work since the browser will still send data to Google directly and that will involve disclosing the user’s IP address in the traffic flow, even if not in the payload of the GA data. This is true, but since Google is acting as a data processor, the user’s IP address being personal data doesn’t impact anything because Google is under the direct instruction of the website data controller. Google has direct permission to use that IP address for receiving the GA data but not for anything else involving the user’s website browsing behaviour.
Anonymisation in Action
The principles of anonymising GA are that you must set GA to anonymise the client IP address (by setting anonymizeIp to true) and must ensure that GA doesn’t capture data in URLs, forms or fields on your website that could help identify an individual user. AnonymizeIp clears the last octet of the IP address, so if your IP address is 18.104.22.168, the GA script in your browser will only send the 111.122.133 part to Google. This means that your GA dashboard will only show users’ geographic location at a country level and not a city or district level. Once you’ve enabled the anonymizeIp setting, you can see it in action on your own site (or someone else’s, such as consent.guide or ico.org.uk). Follow this procedure to take a look:
- Open Chrome, press F12 to open Developer Tools (or right click and select “Inspect”)
- Select the “Network” tab.
- Load your website of choice (e.g. this website or https://ico.org.uk)
- Click the “Name” column to order the results by name
- Find the line that starts with “collect?” and click on that line. This is the Google Analytics request, sending data from your web browser to Google.
- On the right, click on the Headers tab (if it’s not already open)
- Scroll down to the “Query String Parameters” and you’ll see the various pieces of data being sent, including a an “api:1”. If you see that, then the AnonymizeIp function is enabled.
This website (https://consent.guide) uses the anonymizeIp setting to enable GA once the cookie banner has been accepted, giving users the ability to opt out. I could have set this to enable before the banner is accepted but I personally prefer a more informed choice for people on this privacy focused website.
What About Non-Anonymised Google Analytics?
Okay, so you want to capture some personal data and record user analytics in finer detail. There are lots of good reasons why you might want to do this. But you’re now outside of the WP29 anonymised opt-out scenario, so you will need consent from the user. And this consent needs to be captured before you turn on GA. That means a user gets to see your cookie banner, make an informed choice of whether to have GA active or inactive, and only then can it be enabled. If you ever notice that GA is enabled before you accept a cookie banner (like currently on the website of the law firm Fieldfisher or the ICO website), they may very well be using the anonymised opt-out exemption, and thus don’t need consent to enable it.
Images in this post have been kindly provided by: