This article explains how to create a Filter.
*Note: It is helpful to have a basic understanding of RegEx when creating filters.
Go to Configure > Filters. At the top of the page select "New" to create a filter or select an existing filter if you want to edit it.
There are five filter types:
- Include: Will include the parameters you specify and exclude anything else.
- Exclude: Will exclude the parameters you specify and include anything else.
- Advanced: Allows you to manipulate and/or combine data from multiple fields.
- Search and Replace: Finds strings matching your specifications, and replaces them with a new string.
- Raw: Applied before data is processed and before any other filters. Raw filters use include or exclude logic.
An Include filter will match a set of predefined conditions and exclude everything that does not match.
In this particular case only visits to the 'products' page will be included in the reports.
The image below shows an Exclude filter that will ignore all hits from the specified IP addresses.
An Exclude filter will filter out every condition you define and include everything else.
Take a look at the included filter Stem + Query filter show below.
This is an advanced filter which matches anything that has a Page Stem and anything that has a Query String.
It then combines the two strings into one string and inserts it into the Page Stem field.
Advanced Construction: Notice the Output field.
This is where you take the Conditions and build something with them.
Here we have taken the first Condition line, first field, $1:1 (because you can have multiple matching fields in each line), and attached the second Condition line, first field, $2:1.
We have also chosen to place a '?' in between them (with a backslash to escape the regex value of the question mark), like in the raw log files.
This creates the full constructor string $1:1\?$2:1.
Search and Replace
The following Search and Replace filter matches back to back forward slashes in the page stem and replaces it with a single '/'.
Raw filters are applied before any visit or pageview calculations are performed. If you want to exclude a range of IP addresses or a specific user agent, the Raw filter will provide a significant performance improvement over the other filter types.
Raw filters use include / exclude logic only, and are applied directly to the raw contents of the log field.