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

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

For all hits

To anonymize the IP address for all hits sent from a single tracker, use the set command to set the anonymizeIp field to true on the tracker:

ga('set', 'anonymizeIp', true);

For a single hit

To anonymize the IP address of an individual hit, you can set the anonymizeIp field in the fields object for that hit:

ga('send', 'pageview', {
  'anonymizeIp': true

Learn more

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