How to install Google Analytics in accordance with GDPR

ATTENTION: UPDATE JULY 2022

As of late, the Italian Garante has made a ruling against the utilization of Analytics, citing concerns regarding the transfer of user data to the United States. To ensure compliance, if you wish to continue employing Google Analytics on your website, you must:

  • Ensure that Google Analytics 4 is installed.
  • Obtain explicit user consent, as Google Analytics no longer falls under the category of technical cookies.
  • Implement a "data proxification" mechanism to transmit anonymized data to Google's servers.

In response to these requirements, we have developed My Agile Pixel: the ultimate solution for overcoming Analytics blocks.
Visit our site and discover how to seamlessly integrate Google Analytics with My Agile Pixel, enabling its continued use on your website.

The text below serves as a point of reference.


 

Google Analytics allows you to collect statistical data on user behavior on your website.
The cookies installed by Google Analytics are profiling cookies, but if installed with some small precautions they will be assimilated to technical cookies, so they are not subject to user approval. Nevertheless, to comply with the cookie law, its use must be declared.

In this article we will see how to install Google Analytics on your WordPress site thanks to the MyAgilePrivacy plugin.
Before we begin a preface: this guide is dedicated to the installation of Google Universal Analytics and Google Analytics 4 versions.
For older versions (classic version) refer to the dedicated guide by clicking here.

Solution 1 - automatic scan

You can use the advanced "Cookie Shield" feature.

That mode is able to automatically detect this Software, so you simply set the Shield in "Learning" mode, browse the pages of the site, and find your configuration ready.

Otherwise, you can use manual configuration.

Solution 2 - manual configuration

Part 1 - locating the code for Google Universal Analytics or Google Analytics 4

As a first step, locate the code to install Analytics on the site.
It will look something like this below:

An important note if you use UNIVERAL ANALYTICS:
the last line of your code may be different from the one in the image. This may be so:
gtag('config', 'G-0000000000');

Be sure to also include the instruction to anonymize user IPs, which is required for GDPR purposes.
The last line of your code then, should look like this:
gtag('config', 'G-0000000000', { 'anonymize_ip': true });

If you use Google Analytics 4, don't worry: anonymization is always on by default.

Important: Make sure the "Data collection for advertising features" options are turned off. Click here and find out how to do it in 3 easy steps.

Part 2 - Locating the Cookie for Google Analytics on the MyAgilePrivacy Cookie List

In your WordPress website admin, navigate to: MyAgilePrivacy -> Cookie List from the left menu.
Here, you'll find the list of cookies imported upon plugin installation. Initially, they'll all be in a draft state.
Your task is to publish only the cookies relevant to your website.

On this screen you will see a series of columns:

  • Cookie Name: the name of the Cookie
  • Is Necessary: indicates whether or not the cookie is essential to site navigation. If rejecting the cookie makes the site unusable, then it is essential. You will find this information pre-filled in the cookie details.
  • Auto Update: indicates whether the cookie reference text (which we will see in a moment) remains automatically updated or not. If the setting is on "yes," we will automatically take care of updating the cookie reference texts to keep everything up to date according to GDPR regulations.
  • Tails: initially this column is empty. It shows you a preview of the code that is associated with each cookie. Just as we are about to do now with Analytics.

To install Google Analytics, search the list for the one with the title "Google Analytics (Google Inc.)" and click on it.

The detail page contains pre-filled informational text and 2 blank fields where the code can be entered.
The pre-filled text is visible in the cookie policy, and it is that information that is automatically updated to be up-to-date and compliant when the "Allow Automatic Update" setting is set to "yes."

Immediately below the text, you will find the option to select the "Type of Installation" (Javascript and Noscript, or Raw).
Select from the "Raw Code" dropdown, and you will see a field called "raw html code".

Part 3 - Entering the Analytics Code

Now all you have to do is enter the Analytics code exactly as it is provided to you.

Remember to save and publish the Cookie by pressing the blue "Publish" button in the upper right corner.

Final part - verification of proper operation

To verify if you have correctly installed the Analytics code on your website, you can use the tools provided by Google Analytics or contact us for further assistance.

Upon loading any page on your website, you'll observe that Google Analytics will function irrespective of the consents expressed by the user. This is because, as mentioned earlier, the cookies installed by Google Analytics are considered technical cookies and are therefore integral to the site's operation.

Please note that this guide applies to both Google Universal Analytics and Google Analytics 4.
For older versions (classic version) read this guide by clicking here.

Download the free guide

Fill out the form and get immediate access to the guide in PDF format.
Mockup del pdf della guida
Loading in Progress...
Request successfully sent. You will be redirected to the download page shortly
By submitting this form I declare that I have read the privacy policy and authorize the Owner to respond to me for what is expressed in point a of the privacy policy
Warning: Your Cookie choices may not allow the form to be submitted.
Click here to review your preferences.
buy now My Agile Privacy - compliant in less than 3 minutes
a Formula Agile SRL project
VAT ID 04524510403 - REA: RN418884
Viale Medici 16/A, 47922 Rimini (RN) - Italy
Share capital 12'000โ‚ฌ
PEC formulaagilesrl[at]legalmail.it
For assistance: info[at]myagileprivacy.com
GDPR and privacy present complexities that extend beyond achieving website compliance. Compliance obligations span across all business aspects and necessitate expert analysis.
When it comes to implementing Banners and Policies, trust My Agile Privacyโ€”the only solution that excludes unnecessary implementations not mandated by regulations.
Logo CMP partner GoogleLogo CMP partner GoogleLogo IAB Europe approved
My Agile Privacy

This site uses technical and profiling cookies. 

You can accept, reject, or customize the cookies by clicking the desired buttons. 

By closing this notice, you will continue without accepting. 

In addition, this site installs Google Analytics version 4 (GA4), Facebook Remarketing with anonymous data transmission via proxy. 

By giving your consent, the data will be sent anonymously, thus protecting your privacy.