data redaction
Google Analytics

GA4 Data Redaction

Google recently announced the data redaction feature for Google Analytics 4. With this, you can now hide certain query parameter values to prevent PII leaks. Data redaction is quite different from the ‘Exclude URL Query Parameters’ feature we knew from Universal Analytics. Let’s take a closer look.

What is Data Redaction Feature in GA4?

The data redaction feature is a feature recently announced by Google to prevent PII leaks. With this feature, you can specify query or event parameters that contain user information and enable redaction before data processing.

For example, suppose you have a form that operates with the GET method, and when a user fills out and submits the form, the address that they are directed will be like the following:

yoursite.com?name=john&surname=doe&email_adress=johndoe@hotmail.com&phone=1234567

As you can see, there is a lot of user data (PII – Personally Identifiable Information) in the query parameters. This information should not be sent to Google Analytics to comply with GDPR rules.

With the data redaction feature, query parameters such as name, surname, email_address, phone (as shown in the example above) can be redacted, ensuring the security of your user data.

According to Google’s documentation, the redaction process for specified query parameters will be applied to event parameters such as page_location, page_referrer, page_path, link_url, video_url and form_destination. Furthermore, when you activate the “email” feature, it will check all event parameters using a regex pattern, and it will redact any parameter that matches the email pattern.

This feature is different from the “Exclude URL Query Parameters” feature we know from Universal Analytics. The reason for this is that when you omit a query parameter in Universal Analytics, it won’t show up in your reports, but Analytics will still receive and process the data. In contrast, Google Analytics 4 will redact the data before sending it to Analytics, allowing the query parameter names to remain visible.

Example :

if we use the URL that we used above :

INPUTyoursite.com?name=john&surname=doe&email_adress=johndoe@hotmail.com&phone=1234567
OUTPUT yoursite.com
Universal Analytics – Exclude URL Query Parameters

INPUTyoursite.com?name=john&surname=doe&email_adress=johndoe@hotmail.com&phone=1234567
OUTPUTyoursite.com?name=(redacted)&surname=(redacted)&email_adress=(redacted)&phone=(redacted)
Google Analytics 4 – Data Redaction

As you can see in the example above, query parameters will still appear in the reports, but you will see “(redacted)” as their value.

NOTE: An important point to keep in mind about the data redaction feature is that, if you are sending data to Google Analytics using the measurement protocol or using the data import feature, the data will not be redacted.

How to Configure the Data Redaction in GA4?

To be able to use the Data redaction feature, you need to click on the “admin” tab of your Google Analytics 4 account, then select “Data Streams”. Afterward, you should choose the web stream you are actively using and click on the “Redact Data” option.

When you do this, a window will appear where you can redact email addresses and query parameters from certain event parameters. Additionally, you will see a small tab where you can test the redaction process.

In this step you need to define the query parameters for redaction. After specifying the parameters, there is an area called “Test data redaction” where you can test the change and see the output that will be reflected in Analytics.

Leave a Reply

Your email address will not be published. Required fields are marked *