How To Remove Pii Data From Google Analytics

Google Analytics serves as an effective instrument for monitoring website visits and the actions of its users. Yet, it has the capability to gather sensitive personal data that you might prefer not to disclose to Google or additional external entities. In this piece, we’ll guide you on how to eliminate personal identifiable information (PII) from Google Analytics.

Step 1: Identify the Sensitive Data

The first step in removing PII data from Google Analytics is to identify which data points are sensitive. This can include information such as IP addresses, email addresses, and other identifying details.

IP Addresses

One of the most common types of PII collected by Google Analytics is IP addresses. To remove this data, you can use the _anonymizeIp function in your tracking code. This will anonymize the last octet of the user’s IP address before it is sent to Google.

Email Addresses

If you are collecting email addresses through a form or other means, you can use the _setAllowLinker function to prevent Google Analytics from linking this data with other user information. This will help ensure that your users’ email addresses remain private.

Step 2: Implement the Changes

Once you have identified which data points are sensitive, it’s time to implement the changes in your tracking code. You can do this by adding the appropriate functions and settings to your Google Analytics tracking code.

Example Code

ga('create', 'UA-XXXXX-Y', {
  'allowLinker': true,
  'anonymizeIp': true
});

Step 3: Monitor Your Data

After implementing the changes to your tracking code, it’s important to monitor your data to ensure that sensitive information is no longer being collected. You can do this by checking your Google Analytics reports and looking for any instances of PII data.

Example Report

ga('send', 'pageview');

Conclusion

Removing PII data from Google Analytics is an important step in protecting your users’ privacy. By identifying sensitive data points, implementing changes to your tracking code, and monitoring your data, you can ensure that your website remains compliant with privacy laws and regulations.