# Analytics filters and segments

> Filter every dashboard report by source, page, country, event or property, combine conditions with AND and OR groups, and save them as reusable segments.

## Filters

There are two ways to add a filter:

- **Click a row** in a panel or drill-down table. It adds an `is` filter
  for that value, and replaces a filter you already have on the same
  dimension.
- **Filter** (`F`) in the toolbar opens the builder.

| Builder field | What it does |
|---|---|
| Dimension | What to filter on (see [Dimensions](#dimensions)). **Custom event property** shows a second field for the property key |
| Operator | How the value is compared (see [Operators](#operators)) |
| Value | The value to match. Country, device, channel, goal, interaction and screen size have a fixed set of values, so you pick from a menu, or tick several in a checklist for `is any of` and `is none of` (long lists have a search box). Other dimensions take text and suggest their top values of the last 30 days. For a typed list (`is any of`, `is none of`, `is between`), separate values with commas |
| **OR with the last filter** | Puts the new condition in an OR group with the filter added last, instead of AND |
| **Add filter** | Applies it and reloads the page |

Active filters show as chips under the toolbar. **×** on a chip removes
that filter, and **Clear** (`Esc`) removes them all.

Filters apply to every metric, chart and panel on the page, and are kept
in the URL (`filters=…`), so a filtered view can be bookmarked or shared.

### Dimensions

| Dimension | API key | Matches |
|---|---|---|
| Page | `page` | The path of a viewed page, such as `/pricing` |
| Entry page | `entry_page` | The first page of the visit |
| Exit page | `exit_page` | The last page of the visit |
| Hostname | `hostname` | The hostname the visit was on |
| Channel | `channel` | The [channel](/docs/metrics/channels): `paid_search`, `paid_social`, `paid_other`, `email`, `ai_assistants`, `organic_search`, `organic_social`, `internal`, `referral` or `direct`, or a custom channel |
| Referrer | `referrer` | The referring site's hostname |
| Referrer URL | `referrer_url` | The referring hostname and path |
| Ref | `ref` | The `ref`, `via` or `source` query parameter of the landing URL |
| UTM source, medium, campaign, content, term | `utm_source`, `utm_medium`, `utm_campaign`, `utm_content`, `utm_term` | The UTM tag of the landing URL |
| Country | `country` | A two-letter country code, such as `US` |
| Language | `language` | The browser language, as the browser reports it |
| Device | `device` | `desktop`, `mobile`, `tablet`, `tv` or `other` |
| Browser | `browser` | The browser family, such as `Chrome` |
| Browser version | `browser_version` | Family and major version, such as `Chrome 126` |
| Operating system | `os` | The OS family |
| OS version | `os_version` | Family and major version |
| Screen size | `screen` | The screen width group: `xs` (under 414 px), `sm` (under 768), `md` (under 1024), `lg` (under 1440) or `xl` |
| Interaction | `interaction` | Whether the tracker saw real input (pointer, key or touch) in the visit: `seen`, `none` or `unknown` (server-side events and other hits that can't tell) |
| Goal | `goal` | A goal, by its id (`goal_…`) |
| Event | `event` | A custom event, by the name it was sent with |
| Custom event property | `prop:<key>` | The value of a property on a custom event |

### Operators

| Operator | API value | Meaning |
|---|---|---|
| is / is not | `is`, `is_not` | Equals, or doesn't equal, the value exactly |
| is any of / is none of | `any_of`, `none_of` | Equals one of a list, or none of it |
| contains / does not contain | `contains`, `not_contains` | Substring match, ignoring case |
| starts with | `starts_with` | Prefix match, case-sensitive |
| matches pattern / does not match pattern | `regex`, `not_regex` | Regular expression, case-sensitive, up to 200 characters |
| is greater than / is less than | `gt`, `lt` | Compares as numbers. Values that aren't numbers never match |
| is between | `between` | Between two numbers, both included |

The builder offers the operators that fit the dimension: `is`, `is not`,
`is any of` and `is none of` for dimensions picked from a list, the text
operators for the rest, and the number operators for custom event
properties. The API accepts any operator on any dimension. A goal
filter takes goal ids: `is not` and `is none of` exclude visits that
completed the goal, and every other operator keeps them.

### AND and OR

Separate filters are combined with **AND**. Conditions in an OR group
match when any of them does: "channel is Email **or** utm_medium is
newsletter". Up to 20 conditions in total, counting those of an applied
segment.

### What a filter selects

- **Visit dimensions** (source, channel, UTM, country, device, browser,
  entry page and the rest) select visits.
- **Page** selects visits that viewed the page, and pageview counts for
  that page.
- **Event**, **goal** and **property** filters select visits in which that
  event or goal happened.

The JSON syntax used in URLs and the API is in
[Filters (API)](/docs/api/filters).

## Segments

A segment is a saved set of filters with a name, like "Paid traffic from
the US" or "Visits that saw pricing". Choose one with the segment menu
in the toolbar (`S`), which reads **All traffic** when none is applied
and appears once the site has a segment. A segment combines with any
filters you add on top.

Create one in two ways (both need the `content.write` permission):

- **Save as segment** in the toolbar, shown while filters are active,
  saves the current filters under a name.
- **Segments** in the sidebar → **New segment** opens the full form.

| Field | What it does |
|---|---|
| **Name** | Shown in the segment menu (up to 100 characters) |
| **Description** | Optional note shown on the segments list (up to 300 characters) |
| **Filters** | One row per condition: **and** or **or** (an "or" row is grouped with the row above it), a dimension, an operator and a value. Countries, devices, channels (your custom channels included), goals, interaction and screen sizes are picked from a menu, or ticked in a checklist for `is any of` and `is none of`. Text dimensions suggest their top values |
| **Share with everyone on this site** | On: everyone with access to the site can use the segment (**Shared**). Off: only you see it (**Private**) |

While you edit, the form shows a plain-language summary of the filters
and how many visitors matched in the last 30 days.

The segments list has **Apply** (opens the Overview with the segment),
**Edit** and **Delete**.

Use a segment in the API with `segment_id=seg_…`. A private segment of
another member is ignored.
