How to escape a certain word in a url with google analytics regex?

Member

by lew , in category: Third Party Scripts , 24 days ago

How to escape a certain word in a url with google analytics regex?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by larissa , 23 days ago

@lew 

To escape a certain word in a URL when using Google Analytics regex, you can use the backslash () symbol before the word you want to escape.


For example, if you want to track all URLs that contain the word "blog" but not "blogger" in Google Analytics, you can use the following regex pattern: ^/blog/(?!blogger)


This pattern will match any URL that starts with "/blog/" but does not contain the word "blogger" after it.


You can adjust this pattern based on your specific requirements and the word you want to escape in the URL. Just make sure to use the backslash () symbol before the word to escape it in the regex pattern.