How to Anonymize IP Addresses in Google Analytics

Do you want to anonymize IP addresses of your site visitors in Google Analytics? It’s easy with MonsterInsights.

In this guide, we’ll show you how to enable anonymize IP in Google Analytics with MonsterInsights so that you can comply with applicable privacy laws. (Please see an important legal disclaimer at the bottom of this guide.)

Before starting, you’ll need to have MonsterInsights installed, and your Google Analytics account connected.

Please navigate to Insights » Settings » Engagement » Demographics and select the Anonymize IP Addresses check box.

It’s the second checkbox:

The Anonymize IP Addresses toggle will become active.

Please note that this toggle will not be visible if the EU Compliance addon is active because for EU compliance the toggle is auto-selected and it will be visible in the EU Compliance section.

Enabling this setting will add the following code to your tracking:

__gaTracker(‘set’, ‘anonymizeIp’, true);

This code will anonymize the last octet of the IP address of your site visitors before storage.

If you’re going to view the source code of your site to confirm this is working, be sure to clear any site cache (if applicable) and your browser cache, and view in an incognito window before confirming.

Remember: Google Analytics doesn’t collect Personally Identifiable Information by default, and IP’s aren’t ever exposed, but this IP data is used to collect location information such as city and country information.

That’s it! Now you know how to Anonymize IP Addresses in Google Analytics.

Do you need to go further?

If the EU GDPR applies to your business, please see our guide: Getting Started with the EU Compliance Addon.


Legal Disclaimer: This addon is designed to automate some of the settings change required to be in compliance with various EU laws however due to the dynamic nature of websites, no plugin can offer 100% legal compliance. Please consult a specialist internet law attorney to determine if you are in compliance with all applicable laws for your jurisdictions and your use cases.

As a website operator, it is solely your responsibility to ensure that you are in compliance with all applicable laws and regulations governing your use of our plugin.

MonsterInsights, its employees/contractors, and other affiliated parties are not lawyers. Any advice given in our support, documentation, website, other mediums or through our services/products should not be considered legal advice and is for informational and/or educational purposes only and are not guaranteed to be correct, complete or up-to-date, and do not constitute creating/entering an Attorney-Client relationship.