Saved segments
A segment is a combination of filters you save under a name to reapply in one click. Instead of rebuilding the same restriction on every visit (for example browser = Firefox and country ≠ France), you save it once and recall it from any report on the site.
A segment creates no new data: it reuses exactly the filter grammar already available on the dashboard. Saving a segment stores a set of filters; applying it repopulates the live filter bar with that set.
Anatomy of a segment
A segment is an ordered list of predicates (1 to 20). Each predicate carries:
| Field | Values | Role |
|---|---|---|
dim | a known dimension (e.g. browser, country, path) | what the filter targets |
op | is (=) or not (≠) | inclusion or exclusion |
val | the compared value | the expected value |
join | and or or | link with the previous predicate |
The join link only applies from the second predicate onward. By default, two filters on the same dimension are linked with or (Firefox or Chrome), and two filters on different dimensions with and (Firefox and France). You can force either link.
Scope and sharing
A segment is attached to a site and shared across the organization: every member who can see the site sees its segments. The created_by field records the author for reference (empty when the segment is created through an API key).
Managing your segments
The Saved segments panel lives in a site’s advanced options.
- Build your filter combination in the filter bar.
- Click Save, give it a name, confirm.
- To reapply a segment, pick it from the list: the filter bar repopulates.
- If you change the filters of a loaded segment, the panel detects the difference: you can update the segment in place, or save it as new.
- Delete removes the segment for the whole organization.
Creating, updating and deleting are restricted to the site’s management roles (owner/admin). Any member who can read statistics can apply an existing segment.
API
Segments are controllable through the REST API. Operations require an API key carrying the relevant scope — segments:read to read, segments:write to write.
| Method | Route | Scope |
|---|---|---|
GET | /orgs/{org}/sites/{domain}/segments | segments:read |
POST | /orgs/{org}/sites/{domain}/segments | segments:write |
PATCH | /orgs/{org}/sites/{domain}/segments/{id} | segments:write |
DELETE | /orgs/{org}/sites/{domain}/segments/{id} | segments:write |
The body of a POST/PATCH carries a name and a definition — the predicate list described above. An empty definition is rejected.
Next
- Conversion funnels — measure an ordered journey rather than a filter.
- API reference — key authentication and scopes.