# VisitsByFilter: Matomo Matomo Live Visits by Filter ## Documentation One row per visit, most recent first, over one period: the one reporting table which is not aggregated. - Catalog: `Matomo` - Schema: `Live` - Label: Matomo Live Visits by Filter This is a read-only table function. The Matomo API may not support changing the data or the Invantive UniversalSQL driver for Matomo does not cover it. In the latter case, please use the table NativePlatformScalarRequests to upload data to the Matomo API. ## Parameters of Table Function The following parameters can be used to control the behaviour of the table function `VisitsByFilter`. A value must be provided at all times for required parameters, but optional parameters in general do not need to have a value and the execution will default to a pre-defined behaviour. Values can be specified by position and by name. In both cases, all parameters not specified will be evaluated using their default values. Value specification by position is done by listing all values from the first to the last needed value. For example: a `select * from table(value1, value2, value3)` on a table with four parameters will use the default value for the fourth parameter and the specified values for the first three. Value specification by name is done by listing all values that require a value. For example with `select * from table(name1 => value1, name3 => value3)` on the same table will use the default values for the second and fourth parameters and the specified values for the first and third. | Name | Data Type | Required | Default Value | Documentation | |---|:---:|:---:|:---:|---| | `date` | `varchar2` | ☑ | | The date the period is anchored on, or a range such as '2026-08-01,2026-08-31'. | | `filter_limit` | `number` | ☑ | | Maximum number of visits to answer, most recent first. This table always reads a bounded number of visits. | | `filter_offset` | `number` | ☑ | | Number of most-recent visits to skip before the page of filter_limit starts. | | `id_site` | `number` | ☑ | | The Matomo site ID to report on. | | `period` | `varchar2` | ☑ | | The reporting period: day, week, month, year or range. | ## Columns of Table Function The columns of the table function `VisitsByFilter` are shown below. Each column has an SQL data type. | Name | Data Type | Label | Required | Documentation | |---|:---:|---|:---:|---| | `actions` | `int32` | | ☐ | Number of actions (page views, downloads, outlinks, events, site searches) in this visit. | | `browser_name` | `varchar2` | | ☐ | The visitor's browser name. | | `browser_version` | `varchar2` | | ☐ | The visitor's browser version. | | `city` | `varchar2` | | ☐ | The visitor's city, null where Matomo could not geolocate the visitor to city level. | | `continent` | `varchar2` | | ☐ | The visitor's continent, 'Unknown' where Matomo could not geolocate the visitor. | | `country_code` | `varchar2` | | ☐ | Matomo's own two-letter country code, or 'xx' for 'Unknown'. | | `country` | `varchar2` | | ☐ | The visitor's country, 'Unknown' where Matomo could not geolocate the visitor. | | `device_brand` | `varchar2` | | ☐ | The device's brand, 'Unknown' where Matomo could not determine one. | | `device_model` | `varchar2` | | ☐ | The device's model, 'Unknown' where Matomo could not determine one. | | `device_type` | `varchar2` | | ☐ | 'Desktop', 'Smartphone', 'Unknown', ... | | `events` | `int32` | | ☐ | Number of events tracked in this visit. | | `first_action_timestamp_utc` | `int64` | | ☐ | Seconds since the Unix epoch, UTC, of the visit's first action. | | `goal_conversions` | `int32` | | ☐ | Number of goal conversions in this visit. | | `idsite` | `int32` | | ☐ | The Matomo site ID this visit belongs to. | | `idvisit` | `int32` | | ☐ | The visit's own ID. | | `interactions` | `int32` | | ☐ | Number of page-view interactions in this visit. | | `language` | `varchar2` | | ☐ | The visitor's browser language, 'Unknown' where Matomo could not determine one. | | `last_action_date_time_utc` | `varchar2` | | ☐ | The visit's last action (UTC), as Matomo reports it, in the format 'yyyy-MM-dd HH:mm:ss'. | | `last_action_timestamp_utc` | `int64` | | ☐ | Seconds since the Unix epoch, UTC, of the visit's last action so far. | | `operating_system` | `varchar2` | | ☐ | The visitor's operating system name. | | `referrer_keyword` | `varchar2` | | ☐ | The search keyword that referred this visit, where known. | | `referrer_name` | `varchar2` | | ☐ | The search engine, website or campaign name that referred this visit, blank for direct entry. | | `referrer_type_name` | `varchar2` | | ☐ | Human-readable form of referrer_type, for instance 'Direct Entry'. | | `referrer_type` | `varchar2` | | ☐ | 'direct', 'search', 'website', 'campaign' or 'social'. | | `referrer_url` | `varchar2` | | ☐ | The full referring URL, where known. | | `region` | `varchar2` | | ☐ | The visitor's region, null where Matomo could not geolocate the visitor to region level. | | `resolution` | `varchar2` | | ☐ | The visitor's screen resolution, or 'unknown' in lower case where it was not determined. | | `searches` | `int32` | | ☐ | Number of site searches performed in this visit. | | `server_date_pretty_site_local` | `varchar2` | | ☐ | The visit's last action date, formatted in the site's own local time zone. | | `server_time_pretty_site_local` | `varchar2` | | ☐ | The visit's last action, in the site's own local time zone. | | `server_timestamp_utc` | `int64` | | ☐ | Seconds since the Unix epoch, UTC, matching last_action_timestamp_utc on every visit measured so far. | | `total_ecommerce_conversions` | `int32` | | ☐ | Number of ecommerce orders in this visit. | | `total_ecommerce_revenue` | `double` | | ☐ | Total ecommerce revenue across every order in this visit. | | `user_id` | `varchar2` | | ☐ | The User ID tracked on this visit, where the site tracks one - null otherwise. | | `visit_converted` | `int32` | | ☐ | Whether at least one goal was converted in this visit - Matomo's own 0/1 flag, not a Boolean. | | `visit_count` | `int32` | | ☐ | How many visits this visitor has made in total, including this one. | | `visit_duration` | `int32` | | ☐ | Visit duration in seconds - a duration, not a point in time, so carries no UTC/site-local distinction. | | `visit_ecommerce_status` | `varchar2` | | ☐ | 'none', 'ordered', 'orderedThenAbandonedCart' or 'abandonedCart'. | | `visit_ip` | `varchar2` | | ☐ | The visitor's IP address, as Matomo recorded and optionally anonymised it. | | `visitor_id` | `varchar2` | | ☐ | Matomo's own opaque visitor identifier (not a User ID - see user_id). | | `visitor_type` | `varchar2` | | ☐ | 'new' or 'returning'. |