Hi, we have set up two custom dimensions (action) for our tracked website:
dimension1 reflects the id of the tracked page (1,2,3,1020,…)
dimension2 reflects the type of the tracked page (post, event, album, …)
We tracked some pages and the dimensions are added just as we want them to be.
We make an api request to get only the page urls which have assigned the dimension2 with “post”.
https://matomo.kirchenweb.ch/matomo?module=API&idSite=163&period=year&date=today&format=json&filter_limit=-1&expanded=1&token_auth=mytoken&flat=1&method=Actions.getPageUrls&segment=dimension2==post
Sadly also some urls appear which are not assigned the dimension2 with post but event.
We are not sure if this is a bug or if we dont get the idea of how to use the segment filter.
We also tried to create the segment in the ui of matomo but we get the same result.
Would be nice if somebody could help us out here.
Greetins Marco
We are using matomo 3.14.0
Lukas
(Lukas Winkler)
July 22, 2020, 3:41pm
2
Hi,
This sounds like
opened 07:32AM - 22 Jan 20 UTC
Major
Enhancement
Since Segments cannot be used as filter anymore (see https://github.com/matomo-o… rg/matomo/issues/15163) Then I put forward this high priority feature request to add full feature support for Filtering. Suggesting `Custom Reports` plugin as a solution for this feature is not an option. This feature must be part of the core offering.
Most modern web application are data driven and as part of its value proposition it will create dashboard, reports etc to inform its users of the usage of their offering. Building user defined reports/views/dashboards based on user interactions will include filtering, as the user want to see exact results. Filtering and segmentation is the essentials features of any Analytics platform. Hence, we must build this missing feature at its highest priority.
## How
As Matomo also advertise to be a replacement of Google Analytics, then lets see what they do:
> Filtered queries restrict the rows that do (or do not) get included in the result. Each row in the result is tested against the filter: if the filter matches, the row is retained and if it doesn't match, the row is dropped.
> **Dimension filtering**: Filtering occurs before any dimensions are aggregated, so that the returned metrics represent the total for only the relevant dimensions.
> * **Metrics filtering**: Filtering on metrics occurs after the metrics are aggregated.
> * **Valid combinations**: You can filter for a dimension or metric that is not part of your query, provided all dimensions/metrics in the request and the filter are valid combinations. For example, you might want to query for a dated list of pageviews, filtering on a particular browser.
Source: https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters
For rich possibilities of Filtering the massive amount of data a regular website/app gets, we need the following operators:
### Metric Filter Operators
Operator | Description
-- | --
`==` | Equals
`!=` | Does not equal
`>` | Greater than
`<` | Less than
`>=` | Greater than or equal to
`<=` | Less than or equal to
### Dimension Filter Operators
Operator | Description
-- | --
`==` | Exact match
`!=` | Does not match
`=@` | Contains substring
`!@` | Does not contain substring
`=~` | Contains a match for the regular expression
`!~` | Does not match regular expression
It would be a big plus if we could get support for *Regular expression* in those filters.
## Filter Syntax
Given the fact that Segments are alreadty supported, we only need to invent a `filter` parameter.
```
metric_dimension_name operator expression
```
Example:
```
filter=referrerName==Google,referrerName==Bing;country==IN
```
and the linked issues there.