Include only United States, Canada, or Mexico
Suppose you want to limit a chart's information to just data coming from the United States, Mexico, or Canada. Select the chart and add the following filter:
- Include/Exclude: Include
- Dimension: Country
- Match Type: IN
- Value:
United States, Canada, Mexico
You could also do this using 3 OR clauses. But it's easier to use IN with a list.
Exclude "(not set)"
To exclude "(not set)" values from your charts, use an Exclude filter. For example:
- Include/Exclude: Exclude
- Dimension: Campaign
- Match Type: Equals
- Value:
(not set)
Find data at the end of a value
The RegExp Match and RegExp Contains operators let you perform more complex matches. For example, to filter data that contains a value at the end of the data, you can use the end-of-line marker $:
- Include/Exclude: Include
- Dimension: Medium
- Match Type:: RegExp Match
- Value: .
*c$
When applied to the Analytics Medium dimension, you'd include values like "organic" and "cpc."
Understanding the regular expression: .*c$
.*
means "match anything" (including nothing),then the literal letter "c"
$
means the "end of line" character. (To match the beginning of the string, use ^.)
Here's another example:
^c.*k.*$
matches text that begins with the letter c, followed by anything , followed by the letter k, followed by anything until the end of the string. This would match values like "cook", "cookie" and "cake".
Exclude data that doesn't begin with an alphabetic character
Regular expression character classes are a powerful shortcut for matching types characters. For example:
- Include/Exclude: Exclude
- Match Type:: RegExp Match
- Value:
^[[:^alpha:]].*
This will filter out non-alphabetic characters, such as Japanese kanji or Korean Hangul.
Understanding the regular expression: ^[[:^alpha:]].*
^
means "beginning of string"
[[:alpha:]]
is the alphabetic [A-Za-z] character class. [[:^alpha:]] negates the class ("not alphabetic")
.*
means "match anything"