When calling the API with "smartphone" or "Smartphone" in segement getting different results

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:


  1. 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.


  1. 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


  1. 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


  1. 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

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.