-
Understanding the Functionality of a JavaScript Variable: Excluding Personal Information from the URL
Hey there, I’m trying to update a URL by replacing certain keywords using a JavaScript variable before I send it off from Google Tag Manger to Google Analytics 4. Since I’m a bit new to JavaScript, I stumbled upon a variable that seems to substitute certain “banned” keywords in the URL’s query string.
When I test it out, it does seem to work because it replaces the values of these unwanted words. But what I noticed is that it doesn’t replace the value of an email unless the value pattern actually matches a real email. I’m guessing that’s what the ‘piiRegex’ variable does? Can you please confirm that for me?
Also, can you take a glance at my code and see if it generally looks alright? Here it is:
[Insert Code]
Thanks in advance!
Log in to reply.