: Google Analytics Search and Replace filter including request URI parts that have been exluded I have a search and replace filter that should "roll up" pages underneath different apps. MY URLs
I have a search and replace filter that should "roll up" pages underneath different apps.
MY URLs have the structure hostname/app-name/page.htm?query
App name could be one of several options.
My intent is that if I have requests come in on both
example.com/dave/page.htm?query
and
example.com/susan/page.htm?query
That both those requests get counted as "hits" for page.htm
I have the following ^/(dave|susan|adam)/([^?]+)?.*
and have set the replace field to be /2
I can see hits being rolled up for page.htm but am also seeing dave/page.htm and susan/page.htm show up.
What am I doing wrong?
More posts by @Margaret670
1 Comments
Sorted by latest first Latest Oldest Best
Google's documentation for these filters doesn't mention that they can use regular expression groups for matching. I think that when you say /2 you are trying to fill in the second matching group. The normal regular expression syntax for that would include either a $ or a before the number. If it were going to work, it would either be / or /2.
I don't think you need functionality at all. You could just use the regular expression ^/(dave|susan|adam)/ on the Request URI field and replace it with /. That should work because it is almost exactly like the example used on the documentation page.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.