Mobile app version of vmapp.org
Login or Join
Cody1181609

: Google Analytics, filter ALL but a few URL parameters My sites is being bombarded with new and old URL parameters. At first I tried to add those to the list of excluded URL parameters. With

@Cody1181609

Posted in: #GoogleAnalytics #RegularExpression #Traffic

My sites is being bombarded with new and old URL parameters. At first I tried to add those to the list of excluded URL parameters. With that list now exceeding 200, I wanted to try and use a GA advanced filtern.

However, the only filter I found would exclude ALL parameters:


Create an advanced filter
Filter name: remove all query parameters from URI
Filter type: advanced Filter field A: Request URI Filter
Field A pattern: (.)?(.)
Field B: leave it blank
Output field: Request URI
Output pattern: $A1
Override output: YES Case Sensitive: NO


Source

The only parameters I'd like to not be filteted are query and page.
Does anyone know how to alter the regex accordingly?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cody1181609

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sims2060225

Ok, so I was able to to solve my problem.

First I setup a new advanced filter:


Filter name: remove all query parameters from URI except query and page
Filter type: advanced
Filter field A: Request URI Filter
Field A pattern: (.*?)?
Filter field B: Request URI Filter
Field B: ?|&
Output field: Request URI Output pattern: $A1?$B1
Field A required: YES
Field B required: NO
Override output: YES
Case Sensitive: NO


In addition I created a second advanced filter which filters unnecessary ?
at the end of the URL, using the regex


(.*)?$

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme