Google Analytics regular expression to match page URIs at specified path levels

I am trying to create a regex for a page level report in Google Analytics to match pages that exist at a specified level in the path / directory and exclude pages outside of that level in the report.

More specifically, show only the page URI in the report that is at the 5th level of the path, or rather, URIs that contain only 5 "/" and no more.

(The separate drilldown drilldown report in Google Analytics only offers a 4-level breakdown in the path, which is not appropriate in this case.)

Any help would be much appreciated.

Thank.

Edit:

Using the example below, I am currently able to create a regex that matches the following page URIs:

/about/team/member1/bio/info
/about/team/member2/bio/address
/about/team/member2/bio/address?=2335
/about/team/member3/bio/contact
/about/team/member3/bio/contact/method
/about/team/member4/bio/p321
/about/team/member4/bio/p321/test

      

However, I would like the regex to exclude pages above on lines 3,5 and 7, or any other page URIs if they are more than 5 levels in the path. Also, just add that the 5th level in the path can contain any letters and / or numbers.

+2


source to share


1 answer


I'm not sure which regex hero GA is using, but this is pretty standard and matches all lines except 3.5 and 7.

^(?:/[a-zA-Z0-9]+){1,5}$

      



In case GA does not support non-capture groups, follow these steps:

^(/[a-zA-Z0-9]+){1,5}$

      

+1


source







All Articles