[GA4] Data redaction

Configure web data streams to perform client-side text redaction of email addresses and user-defined URL Query Parameters.

The data-redaction feature helps to prevent the inadvertent collection of PII in the form of email addresses and URL query parameters. Data redaction uses text patterns to identify likely email addresses across all event parameters and the URL query parameters that are included as part of the event parameters page_location, page_referrer, page_path, link_url, video_url, and form_destination.

URL query parameter: A key-value pair (e.g., language=english) that follows the question mark (?) at the end of a URL. For example, the value for the event parameter page_location might be the URL and query parameters https://www.example.com/us?language=english&catalog=summer23.

Data redaction evaluates events before they are collected to find and remove any text it understands as an email address or query parameter key-value pair. After removal of the offending text, data collection proceeds as expected.

You configure data redaction as one of the settings for a web data stream.

When you create a new property, email data redaction is on by default. For properties that you created before the release of this feature, you need to enable data redaction using the instructions below.

It's important to remember that while data redaction provides a powerful tool against inadvertently collecting PII, the ultimate responsibility for meeting regulatory requirements still lies with the entity collecting data. To further help you meet that responsibility, this feature lets you test your configuration to understand whether the text patterns you identify are redacted as expected (learn more). You can also use Debug View to monitor in real time how Analytics collects events from your site.

Some things to keep in mind

Data redaction is currently available only for web data streams.

Data redaction evaluates event data for email addresses on a best-effort basis.

Data redaction occurs client side after Analytics modifies or creates events (which also occurs client side) and before data is sent to Analytics.

Data redaction accepts percent-encoded URL query parameters, including Unicode characters accepted by browsers. For example, if you enter 名 as a query parameter, and enter https://www.example.com?名=john as a test URL, data redaction will interpret it as follows:

Test URL after you enter it Redacted version
http://www.example.com/?%E5%90%8D=john http://www.example.com/?%E5%90%8D=(redacted)

 

Data redaction may incorrectly interpret text as an email address and redact the text; for example, if the text includes "@" followed by a top-level domain name (e.g., example.com) it may be incorrectly removed.

Data redaction does not evaluate HTTP-header values, (for example referer, which may contain query parameters on older browsers).

Data redaction won't prevent the collection of PII via Measurement Protocol or Data Import.

Configure data redaction

  1. In Admin, under Data collection and modification, click Data streams.
    Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector. You must be an Editor or above at the property level to configure data redaction.
  2. Click the relevant web data stream.
  3. In the Events section, click Redact data.
  4. If you want to redact email addresses and/or URL query parameters, turn on the switch for each option.
  5. If you choose to redact URL query parameters, enter a list of the query parameters you want to redact (e.g., firstname, lastname, email_address). Press return/Enter after each parameter.

Use the Test data redaction section to see how Analytics removes data. Analytics will test for the options you chose in Step 5 above.

  1. Enter sample text containing an email address, or a URL that includes the query parameters you entered in Step 6 above along with sample values (e.g., https://www.example.com/settings?firstname=John&lastname=Doe&email_address=johndoe@example.com).
  2. Click Preview redacted data.

 

Under Redacted version, you'll see an example of the data that Analytics would collect given your settings. For example, if your sample text is:

https://www.example.com/?firstname=John&lastname=Doe&email_address=johandoe@example.com

then the redacted version will be:

https://www.example.com/?firstname=(redacted)&lastname=(redacted)&email_address=(redacted)

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
14182875220540547368
true
Search Help Center
true
true
true
true
true
69256
true
false