This repository contains a Google Tag Manager Server Variable template that makes it possible to clean up URLs to remove any personally identifiable information (PII) before sending them to analytics or third-party platforms.
A URL from event data {{ED - Page Location}} (event_data.page_location).
List the query parameter keys to redact, delete or mask. You can use different matching condition options.
Query parameter values with dynamic or unknown keys can be redacted if the value matches a specified regular expression.
Make sure to default the false
value to the initial input, in case any error happens during the replacement of the URL.
See our contributing guidelines.