Open alexhebing opened 7 months ago
Hi @alexhebing,
sorry this type confusion is causing you trouble. This was not a deliberate change, but probably gone wrong along the way to the new major release.
We will check what happened here and how to fix it.
At my job we just noticed this as well having recently upgraded our Matomo instance from 4 to 5.
I can see even in the sample JSON output from the docs that several "nb_vists" and "nb_events" are returned as strings: https://demo.matomo.cloud/?module=API&method=Events.getName&idSite=1&period=day&date=yesterday&format=JSON&token_auth=anonymous
What happened?
We have a self-hosted Matomo that we try to keep up-to-date as much as possible. Our data is being imported into datawarehouse (and subsequently into PowerBI), and this includes event data, that are requested from the
Event.getAction
API endpoint. Our developer notices inconsistencies in the datatypes. Here is an example of what I mean:Another example, with some more details. I suspected that this had to do with the major version update from Matomo 4 to 5 that we did at the beginning of the year. Here is a response from the API retrieved in september 2023:
As you can see, this has integer values. Same API, same website, but in february 2024:
Strings instead of integers.
Is this due to the new version? We were unable to find mention of this in the release notes. I also searched the issues here, and the forum, but found no mention of this issue. Any ideas?
Please note that we are always on a recent version of Matomo, i.e. at the moment that is 5.0.2. I don't know exactly which version it was in september 2023, but I suspect that it must have been 4.15.1.
What should happen?
One would expect the datatypes to be consistent, and most of all that
nb_
values would actually contain an numeric value, instead of a string.How can this be reproduced?
I am not sure exactly, but I would suspect requesting the mentioned data from the API in the versions mentioned would produce results like these.
Matomo version
5.0.2
PHP version
8.1.27
Server operating system
Debian 11
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