google vibrant building window

Remove PII with GA4 Data Redaction


Data privacy is becoming increasingly important, with regulations like GDPR and CCPA aiming to give users more control over their personal information. However, businesses can sometimes inadvertently collect personally identifiable information (PII) through their analytics platforms. Google Analytics 4 (GA4)’s recent update offers a new data redaction feature that helps automatically remove PII from your analytics data. In this article, we’ll explore how Google’s GA4 data redaction capabilities work and guide you through configuring data redaction for your web data streams.

Understanding GA4 Data Redaction

Data redaction refers to automatically removing or obscuring sensitive personal information within data sets before collection and storage. For web analytics platforms like GA4, data redaction focuses on redacting email addresses and URL query parameters that may contain PII.

Here’s how it works: data redaction uses text patterns to identify strings that look like emails or custom URL parameters you want to redact. When it detects potential PII, the data is removed before that event or hit is sent to Google Analytics servers.

For example, your website collects a user’s email via a contact form. The email submission event that gets fired may contain the user’s email address as a parameter. With data redaction enabled, the email address gets automatically scrubbed from the data, so only anonymous analytics data is collected.

URL query parameters refer to the key-value pairs that appear after a question mark in a URL, like ?firstname=John&lastname=Doe. Data redaction allows you to specify particular query parameters to redact.

How Data GA4 Data Redaction Works

GA4’s data redaction capability evaluates events on the client side before the data gets sent to Google Analytics servers. Here is the specific process:

Your site generates an event to be collected, which contains parameters like page URLs, referring URLs, etc.

The Google Analytics snippet on your site intercepts events to modify/process them before sending them to GA servers.

Data redaction does a check on events for any text resembling email addresses or query params you want to be redacted based on text patterns.

Any potential emails or specified query params are removed from the events.

As usual, The redacted event data gets sent to Google Analytics for collection and analysis.

A key benefit of this client-side implementation is that your raw analytics event data never exposes sensitive information to Google servers. PII gets redacted earlier before data leaves the user’s browser.

Configuring GA4 Data Redaction

To start redacting data in GA4, you must enable and configure redaction for your web data streams. Here are step-by-step instructions:

GA4 data redaction settings
GA4 data redaction settings

In the GA4 interface, click Admin and navigate to your property.

Click Data Streams and select your web data stream.

Under Events, click Redact data.

Turn on the switches for Email addresses and/or URL query parameters depending on what you want to redact.

If redacting URL parameters, enter each one you want to be obscured on a separate line. For example:

Click Apply to save your redaction settings.

For properties created before this feature launched, data redaction is off by default. Follow the same steps to enable it. New properties have email redaction enabled automatically.

Testing Your Configuration

Testing that your data redaction configuration works as expected before fully launching it is essential.

Use the “Test GA4 data redaction” section to see redaction in action. Enter a sample text snippet or URL containing an email or the query parameters you want redacted.

Click “Preview redacted data” to see an example of how Analytics would collect the data based on your settings.

For example, you could input a test URL like:

The redacted version would show:

Considerations and Limitations

While data redaction provides powerful new privacy capabilities, it’s essential to be aware of some current limitations:

Only available for web data streams at this time. Other data sources are not covered.

Redaction works on a best-effort basis, particularly for email addresses. May miss certain edge cases.

Do not evaluate or redact any HTTP header values.

This does not apply to analytics data sent via Measurement Protocol or data imports.

Also, remember that while data redaction automates part of the privacy process, you still need comprehensive efforts to comply with regulations like GDPR. Configure user controls, use additional tools like Debug View and conduct privacy reviews of your data practices.


Google’s new release of GA4 data redaction capabilities provide a streamlined way to improve privacy protections for your analytics data. Automated redaction of emails and URL parameters helps reduce the risk of accidentally collecting personally identifiable information.

However, this feature is only a partial solution. You still need robust data governance policies, consent flows, access controls, and auditing processes. Use data redaction as part of a layered analytics privacy and compliance approach.

Take the time to properly configure and test data redaction for your web streams. Avoid collecting unnecessary Personally Identifiable Information (PII), build user trust, and rest easier knowing your analytics data has more significant privacy safeguards.

Share the Post:

Related Posts