Google Analytics IP Anonymization and GDPR

Enabling Google Analytics IP Anonymization feature is a best practice for websites that want to comply with GDPR. This guide includes instructions for enabling this feature with gtag.js, analytics.js, and Google Tag Manager.

Google Analytics default behavior relies on identifying individual visitors to track and analyze activities on a website. If you have concerns about using Google Analytics in relation to GDPR compliance, we recommend enabling Google’s IP Anonymization feature in the EU. This feature allows you to mask or anonymize your visitor’s IP address before sending that user data to Google Analytics. 

Visit the Google Analytics IP anonymization docs for more details on this feature. 

Implementing IP Anonymization in Google Analytics

IP Anonymization with gtab.js

If you are using gtab.js, follow Google’s instructions for enabling IP anonymization with gtag.js.

IP Anonymization with analytics.js

If you are using gtab.js, follow Google’s instructions for enabling IP anonymization with analytics.js

IP Anonymization with Google Tag Manager (GTM)

Follow these instructions to enable IP anonymization for Google Analytics if you are using Google Tag Manager. 

  1. In your Google Tag Manager account, open the Google Analytics tag for your website. 
  2. Click the edit icon. 
  3. In Tag Configuration, choose more settings and expand the “fields to set” option.
  4. Click +Add Field and set the field name as “anonymizeip”.
  5. Set the Value to true and click save.
  6. Once saved, submit and publish your new setup. 

Testing IP Anonymization

  1. Open your website where IP-address anonymization is in place.
  2. Open your developer tools (Chrome | Firefox | Safari). 
  3. Go to the “Network” tab and refresh your webpage. 
  4. In the search box in the upper left-hand corner, search for “collect”. 
  5. Click on the listing that includes
  6. Once opened, do a search (Mac: command + F | Windows: Ctrl + F ) for the IP anonymization parameter: aip = 1. 
  7. If the aip = 1 parameter exists, you have correctly set up Google Analytics’s IP anonymization option.