The officially supported Matomo Connector for Looker Studio enables you to explore your Matomo data in Looker Studio at no cost. You can connect to both Matomo Cloud instances or On-Premise instances using just a Matomo Auth Token.
In PHP, the Matomo API returns a report's rows as an array with numeric keys. There are, however, special rows that can have a negative index (like the summary row). When not used, the JSON printed out will be a normal array (ie, [...]). But when those special rows are included, the JSON will be an object (ie, {...}). The problem with this is that there is a hard limit on the number of keys that can be included in an JavaScript object, 65535 (in Apps Script at least). So if the number of rows exceeds this limit, an exception will be thrown when trying to parse the Matomo API's JSON response.
Working around this issue by limiting the maximum number of rows fetched at a time to 50,000.
[ ] Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
[ ] Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
Description:
In PHP, the Matomo API returns a report's rows as an array with numeric keys. There are, however, special rows that can have a negative index (like the summary row). When not used, the JSON printed out will be a normal array (ie,
[...]
). But when those special rows are included, the JSON will be an object (ie,{...}
). The problem with this is that there is a hard limit on the number of keys that can be included in an JavaScript object, 65535 (in Apps Script at least). So if the number of rows exceeds this limit, an exception will be thrown when trying to parse the Matomo API's JSON response.Working around this issue by limiting the maximum number of rows fetched at a time to 50,000.
Review