Skip to content

Segments

A segment is a set of filters saved under a name for one site, such as “Mobile from Germany”. Pick it from a report’s Filter menu, and it stays on as you move between reports. Everyone in the workspace can use, save, and change a site’s segments.

Where to find it

  • In a report: Filter › Segments lists the site’s segments, with each one’s conditions under its name.
  • In settings: Settings › Segments, under Site in the sidebar, lists them with how many visits each matched in the last 30 days. Make, change, and delete them there; Manage segments in the Filter menu goes to it.

Save filters as a segment

1

Add the filters you want in any report (Filter reports).

2

Open Filter › Segments and select Save current filters as a segment…

3

Name it. We suggest a name from its values, such as “Mobile · Sweden”. The dialog lists the conditions; all must match. Select Save segment.

The report moves onto the segment: its chip, with a bookmark and its name, takes the filters’ place.

Make one in Settings

1

Open Settings › Segments and select New segment.

2

Name it and set a condition: a field, “is”, and a value. Select Add condition for another field; each field can be used once.

3

Pick each value from those seen in the last 30 days, largest first. For Page, Entry page, Hostname, Source, and the campaign tags, you can also type one and select Use “…”.

4

Check the count. As you go, it shows how many visits match in the last 30 days, and their share of all. Select Save segment.

Page and Entry page take a pattern ending in *, as goals do: /docs/* is every page under /docs/. A Hostname is exact, such as docs.example.com, without * or a path.

Use a segment

  • Pick it in Filter › Segments. Select it again to take it off, or select × on its chip. The chip comes first under the toolbar, with the segment’s conditions beside it on wide screens, and the status line says “1 segment”.
  • It stays on as you move between reports from the sidebar, with the period and the comparison. Realtime, Heatmaps, and Errors don’t take segments.
  • Filters narrow it further. The segment’s own fields stay fixed: the Filter menu shows their values marked “· segment”, and on the Overview their rows can’t be selected. Picking a segment removes filters on the fields it sets.
  • To keep a segment and filters together, select Save current filters as a segment… again. The new segment holds both. If a filter contradicts the segment on one of its fields, it can’t be saved, and the menu says so.

How a segment counts

A segment’s conditions match as filters do: all must match, and a visit matches Page when it viewed a matching page. The difference is where they apply. A segment decides which visits a report counts at all: every total, chart, and list, the Filter menu’s included, leaves out the visits outside it. Filters then narrow what’s left.

A segment is stored as its name and conditions, nothing about any visitor. Changing it applies wherever it’s in use: a copied link or API request names it by its ID and reads its current conditions.

Change or delete a segment

In Settings › Segments, select Edit (the pencil) beside a segment to change it in place, then Save changes. Select Delete (the trash can), then Delete segment to confirm; it can’t be undone. Reports that use a deleted segment show every visit instead, and a link that still names it shows its chip as deleted.

Admins and members alike can save, change, and delete segments.

In the API and MCP

The API and assistants connected with MCP take a saved segment by its ID: the value after segment= in a report’s address once you pick it. IDs start with sg_.

The Overview for a segment
curl -G https://app.lyli.io/api/v1/sites/s_k3m9x2p7qa/overview \
  -H "Authorization: Bearer $LYLI_API_KEY" \
  -d period=30d \
  -d segment=sg_…

Limits

  • Up to 50 segments a site, each named in up to 60 characters.
  • Sample sites have fixed segments to try, and can’t save any. In the live demo, harbor.example has Mobile from Germany, Search visitors, and Docs readers.
  • Share links don’t use segments: a shared view has the plain filters only.
  • Saved reports don’t keep a segment. Pick it from Filter.
  • History imported from Google Analytics is daily totals, so the Overview leaves imported days out under a segment, and says so.