How to anonymize user data in Google Analytics 4

Written by

Ira Holubovska

Updated Sep 15, 2025 comments

Why should you remove PII from Google Analytics 4

How to approach user data anonymization

Remove user data from Google Analytics with the help of Anonymizer

anonymize user data in server gtm - stape
Anonymizer power-up in stape

General Info

Parameter name DescriptionGA4 ParameterAnonymize

System info

User Agent Parsed

Ads Campaign Attribution

Manually remove PII from GA4 using GTM

1. IP address

“It should be noted that online identifiers, such as IP addresses or information stored in cookies can commonly be used to identify a user, particularly when combined with other similar types of information. This is illustrated by Recital 30 GDPR, according to which the assignment of online identifiers such as IP addresses and cookie identifiers to natural persons or their devices may "leave traces which, in particular when combined with unique identifiers and other information received by the servers, may be used to create profiles of the natural persons and identify them.''

This is what CNIL (french regulator) says about the IP

remove user IP

2. User identifiers

“ To ensure effective pseudonymization, the algorithm performing the replacement should ensure a sufficient level of collision (i.e., a sufficient probability that two different identifiers will give an identical result after a hash) and include a time-varying component (adding a value to the hashed data that evolves over time so that the hash result is not always the same for the same identifier).”

This is what CNIL says about client ID.

hash client ID
rewrite client ID
override google analytics cookies

3. External referrer

remove external referrer

4. Parameters contained in the collected URLs

remove URL parameters GA4

5. Information that can be used to generate a fingerprint

remove data that can be used to generate fingerprint

6. Any lasting or cross-site identifiers

7. Any other data that can lead to re-identification

How to test anonymization

test GA4 user data anonymization
test GA4 user data anonymization GA4 debugger

Conclusion

Frequently asked questions

gtag('config', 'TARGET-ID', { 'transport_url': 'https://analytics.example.com', 'first_party_collection': true, });

Want to start on the server side?

Try for free

Written by

Ira Holubovska

Content writer

Ira has 10+ years of digital marketing experience, with the last 5 focused on server-side tracking. She understands how and when it works across various digital marketing scenarios.

Was this article helpful?

Comments

Recommended for you

Turn better tracking into better marketing performance

Try for free