matomo-org / looker-studio-connector

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.
https://matomo.org/guide/apis/looker-studio/
6 stars 1 forks source link

Fix "Too many properties to enumerate error" #28

Closed diosmosis closed 8 months ago

diosmosis commented 8 months ago

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