Hi we are using the following url to get some data:
/?module=API&method=Actions.getPageUrls&idSite=1&format=JSON&date=last90&period=day&segment=deviceType==smartphone
For this request we used “smartphone” as writting in the documentation here:
https://developer.matomo.org/api-reference/reporting-api-segmentation
But we get empty values.
If we switch “smartphone” to “Smartphone” we will get Data in some cases entries we also got with “smartphone”.
Is this a known issue or bug, is it desired?
Its also the case even if i use smartphone and Smartphone im getting no results at all. Only when i remove the segmentation i get results.
Hi @breitseite-dev ,
The default pattern is “smartphone” but on my xxxx.matomo.cloud it worked the same: smartphone and Smartphone both gave the same data.
If you are using Matomo On Premises, maybe you can invalidate the data and try again. And update versions to the latest Matomo.
Here is a guide for invalidating:
https://matomo.org/faq/how-to/faq_155/
Then search in our reported bugs, here:
Hi Genest,
we are already at version 5.1.0.
This is currently unreliable, we cannot always look for missing data and then invalidate the data.
We are using data from the API in production and critical processes work with it. I there nothing we can do to fix this, i dont understand how its smartphone or Smartphone and that its changing from time to time.
Invalidated all data:
Call
?module=API&method=Actions.getPageUrls&idSite=1&format=JSON&date=2024-09-11,2024-09-12&period=day&segment=deviceType==phablet,deviceType==Phablet
Doesnt work gets 0 results per day.
Call
?module=API&method=Actions.getPageUrls&idSite=1&format=JSON&date=2024-09-05,2024-09-06&period=day&segment=deviceType==phablet,deviceType==Phablet
Works
Call
?module=API&method=Actions.getPageUrls&idSite=1&format=JSON&date=2024-09-11,2024-09-12&period=day&segment=deviceType==phablet
Works gets data
Call
?module=API&method=Actions.getPageUrls&idSite=1&format=JSON&date=2024-09-11,2024-09-12&period=day&segment=deviceType==Phablet
gets the same data as the 3. call but if i have or in segements on the 11 the api returns an empty array.
Tried another call pages that have Desktop visits are not shown with this call:
?module=API&method=Actions.getPageUrls&idSite=1&format=JSON&date=last2&period=day&segment=deviceType==Desktop
but shown as result without the segment filter.
if i do this segment=deviceType==Desktop,deviceType==desktop i get the results.
segment=deviceType=^desktop also works
Im confused by this API.
Hi @breitseite-dev , @MisterGenest
Couldn’t it the database comparison mode that could be case sensitive, for example?
i opened an issue, tried everything including invalidating data
opened 02:49PM - 18 Sep 24 UTC
Potential Bug
To Triage
### What happened?
We are calling
/?module=API&method=Actions.getPageUrls&… idSite=1&format=JSON&date=2024-09-17,2024-09-18&period=day&segment=deviceType==Phablet
or
/?module=API&method=Actions.getPageUrls&idSite=1&format=JSON&date=2024-09-17,2024-09-18&period=day&segment=deviceType==phablet
One day we are getting results for phablet but none for Phablet and the next day we are getting results for Phablet but not for phablet
My post on the community forum:
https://forum.matomo.org/t/when-calling-the-api-with-smartphone-or-smartphone-in-segement-getting-different-results/59396/4
This happens for all devices and we cannot figure out what is happening here.
** EDIT
With the operator =^ starts With and "phablet", "smartphone" etc it seemed to be consistent first but then on some days i get the same results for =^phablet and for =^smartphone
It looks like the newest Data is not available with "phablet" but "Phablet"
The difference of nb_unique_visits is in those files:
[P_hablet.json](https://github.com/user-attachments/files/17047286/P_hablet.json)
[phablet.json](https://github.com/user-attachments/files/17047288/phablet.json)
With segement=deviceType=@smartphone i get more nb_uniq_visitors than without segmentation
### What should happen?
1. We should get the same data for "Phablet" or "phablet".
or
2. One of those two should be considered an invalid parameter and throw an error
### How can this be reproduced?
Import data to matomo and call the method Actions.getPageUrls with segmentation.
### Matomo version
5.1.1
### PHP version
PHP 8.2.21 (cli) (built: Jul 19 2024 10:33:10) (NTS)
### Server operating system
Debian GNU/Linux 12 (bookworm)
### What browsers are you seeing the problem on?
Not applicable (e.g. an API call etc.)
### Computer operating system
_No response_
### Relevant log output
_No response_
### Validations
- [X] Read our [Contributing Guidelines](https://github.com/matomo-org/matomo/blob/5.x-dev/CONTRIBUTING.md).
- [X] Follow our [Security Policy](https://github.com/matomo-org/matomo/blob/5.x-dev/SECURITY.md).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating duplicates.
- [X] The provided steps to reproduce is a [minimal reproducible](https://stackoverflow.com/help/minimal-reproducible-example) of the Bug.
Now even the problem there are some clicks on desktop and if they are in the marts the numbers of unique clicks is 104 but if i do a segmentation without desktop its 129. This whole thing doesnt add up.