Mobile app version of vmapp.org
Login or Join
Margaret670

: 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

@Margaret670

Posted in: #GoogleAnalytics #RegularExpression

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Margaret670

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme