How can I use regex for "contains this word"
12,233
You don't need a regex for an exact string match, but if you must:
/#\/thankYou/
or as @Sundar points out, you may not need to escape anything:
#/thankYou
Related videos on Youtube
Author by
user2548261
Updated on July 08, 2022Comments
-
user2548261 almost 2 years
I'm trying to setup tracking in Google Analytics.
The goal URL is:
www.example.com/jdsfdf?sdfffs#/thankYou
Every time Google Analytics sees
#/thankYou
in the URL, I want it to attribute that as a conversion.How can I use regex to say
if the URL contains #/thankYou, then it's a conversion
?-
Sam I am says Reinstate Monica over 10 yearsthe regex sould be as simple as the (escaped) string you're looking for.
-
-
Sundar R over 10 yearsI don't know if Google Analytics asks the regex to be surrounded by // characters (support.google.com/analytics/answer/1034324?hl=en does not mention it), but if it does not, we don't even need to escape the /, it's just the exact literal string #/thankYou