Skip to content

Instantly share code, notes, and snippets.

@SNemzer
SNemzer / pii_removal_tag.html
Last active June 7, 2021 11:06
Custom HTML tag for GTM to strip PII from titles and URLs
<script>
//Extract Parameters into array
function extractParams() {
var urlParams = {},
match,
search = /([^&=]+)=?([^&]*)/g,
query = window.location.search.substring(1);
while (match = search.exec(query)) {
urlParams[match[1]] = match[2];
}