Disconnect Google Analytics from your site in Drupal

Disconnect Google Analytics from your site in Drupal

Would you like to disconnect Google Analytics from your site in Drupal 7 or Drupal 9? Read our guide and find out how to do it.

We have already told you about the need to disconnect your site from Google Analytics. The Data Protection Authority has, in fact, issued a negative opinion on the legitimacy of the service. 

Today we will explain how to remove Google Analytics from your site in Drupal. This is a generic procedure, which may not apply to all sites.

Before you begin, however, you should read our guide and check whether Google Analytics is actually present on your site.

Step 1. Disconnect Google Analytics from sites in Drupal 9

Drupal 9

Was your site developed in Drupal? Here's how to disconnect it from Analytics. 
The following instructions refer to Drupal 9. 

1. Log in to the backend of your site; 
2. Click on Extend;

3. In the List section, look for the Google Analytics module and click on Configure: from here you can see if the Analytics code has been added;

4. If you found it, click on Uninstall and look for Analytics among the results. After that, select it and finally click on Uninstall.

5. Confirm the uninstallation;

6. Clear the site's cache;

7. Check anonymously that Google Analytics cookies no longer appear by following the procedure outlined above;

8. Update your site's Privacy Policy. How? Keep on reading.

Drupal 7

Is your site in Drupal 7? Here's how to proceed: 

1. Log in to the site;

2. Click on Modules;

3. Check "Off" on Google Analytics and, if present, on Google Tag Manager;

4. Update the Privacy Policy.

Step 2 - Update your Drupal site's Privacy & Cookie Policy

Here is the process for updating your site's Privacy Policy:

  • Click on Content;
  • Search for Privacy Policy (type Privacy Policy in the search bar and then click on Filter), then select the item and click on Edit;

  • Update the Cookie Policy by removing all the entries related to Google Analytics (which are the ones beginning with _ga_) from the table;

  • Click on Save;

  • Remember to update the table for every language on the site;
  • Clear the site's cache;
  • Check from incognito that Google Analytics-related entries are no longer present, following the procedure previously illustrated (Inspect, Application, Cookies).

We have illustrated the easiest and most straightforward method. Keep in mind, however, that it’s possible that for some sites the process may be different and therefore requires the intervention of a technician.
To make sure your site is compliant or to install alternatives to Google Analytics that allow you to collect analytics, contact us. Our team is at your disposal.