Universal Analytics (UA) will be deprecated on July 1, 2023, which means it will stop processing data. Analytics 360 properties will stop working on October 1, 2023. Migrate to Google Analytics 4.

IP anonymization with gtag.js

Stay organized with collections Save and categorize content based on your preferences.

In some cases, you might need to anonymize the IP addresses of hits sent to Google Analytics.

For all events

To anonymize IP addresses for all events, update the config for your property by setting the value of the anonymize_ip parameter to true:

gtag('config', '<GA_MEASUREMENT_ID>', { 'anonymize_ip': true });

For a single event

To anonymize the IP address for a single event, set the anonymize_ip parameter in the parameters object:

gtag('event', 'your_event', { 'anonymize_ip': true });

Learn more

To learn how IP anonymization works, read the IP Anonymization in Google Analytics article in the help center.