takt

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:

FieldValuesRole
dima known dimension (e.g. browser, country, path)what the filter targets
opis (=) or not (≠)inclusion or exclusion
valthe compared valuethe expected value
joinand or orlink 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).

Segment names are unique per site. Trying to save a segment under a name already taken returns an error; update the existing segment instead, or pick another name.

Managing your segments

The Saved segments panel lives in a site’s advanced options.

  1. Build your filter combination in the filter bar.
  2. Click Save, give it a name, confirm.
  3. To reapply a segment, pick it from the list: the filter bar repopulates.
  4. 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.
  5. 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.

MethodRouteScope
GET/orgs/{org}/sites/{domain}/segmentssegments:read
POST/orgs/{org}/sites/{domain}/segmentssegments: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