# Segments: Matomo Matomo Segment Editor Segments ## Documentation A saved visitor filter, reusable across every reporting table's own segment parameter (out of this table's own scope - not yet wired to a segment argument on VisitsSummary.VisitsSummaries or its siblings). - Catalog: `Matomo` - Schema: `SegmentEditor` - Primary Keys: `idsegment` - Label: Matomo Segment Editor Segments Can retrieve data and change data using insert, update and delete. ## Table Columns The columns of the table `Segments` are shown below. Each column has an SQL data type. A new non-null value must be provided for every required column at all times during insert and update. | Name | Data Type | Label | Required | Documentation | |---|:---:|---|:---:|---| | `auto_archive` | `int32` | | ☑ | 1 if reports for this segment are pre-archived rather than computed on demand, 0 otherwise. | | `definition` | `varchar2` | | ☑ | The filter itself, in Matomo's own segment expression language, for instance 'visitCount>0;visitorType==new' (';' is AND, ',' is OR). Verified 2026-08-28 to round-trip unchanged through this column as plain text - Matomo escapes its own reserved characters ('#'/'''/'&') on the way in and reverses it on the way out, no JSON-level handling needed here. | | `deleted` | `int32` | | ☑ | 1 if the segment is soft-deleted, 0 otherwise. Read-only - see the remark on delete() above; this table's own SELECT never actually answers a row with this column set to 1. | | `enable_all_users` | `int32` | | ☑ | 1 if every user may see and use this segment, 0 if it is private to the account named in the login column. Setting this to 1 requires superuser access - Matomo's own checkEnabledAllUsers() rule, verified 2026-08-28. | | `enable_only_idsite` | `int32` | | ☑ | The one site this segment is scoped to, or 0 for a segment visible across every site. Creating or updating an all-sites segment (0, or the column left unset) requires superuser access - Matomo's own checkIdSite() rule, verified 2026-08-28. | | `hash` | `varchar2` | | ☑ | Matomo's own hash of the segment definition, used internally to key its archive cache. Read-only. | | `idsegment` | `int32` | | ☑ | Segment ID: primary key. Matomo's own getAll()/get() answer it as 'idsegment'; update/delete take it as 'idSegment' instead, hence the explicit updatePath. Assigned by Matomo on insert, never written. | | `login` | `varchar2` | | ☑ | Account which owns the segment. Read-only: neither add() nor update() takes a login argument - a segment is always created under the connected account. | | `name` | `varchar2` | | ☑ | Segment name. | | `starred_by` | `varchar2` | | ☐ | Login of the account which starred the segment, or null if it is not starred. Read-only, same reason as starred. | | `starred` | `int32` | | ☑ | 1 if the segment is starred (pinned) by its owner, 0 otherwise. Read-only: starring goes through the separate star()/unstar() calls, which this driver does not yet wire up. | | `ts_created` | `varchar2` | | ☐ | Date and time the segment was created, as returned by Matomo. Matomo does not document which time zone this is expressed in. Read-only. | | `ts_last_edit` | `varchar2` | | ☐ | Date and time the segment was last changed, as returned by Matomo, or null if it never has been. Matomo does not document which time zone this is expressed in. Read-only. |