Hello.
I am trying to use Matomos REST-api (https://developer.matomo.org/api-reference/reporting-api) to get user statistics from four specific webpages. To get information about a specific page I use the: Actions.getPageUrl method. I also specify that period should be month, and date should be last month (I intend to run the script continuously every month - getting last months statistics).
This seems to be working fine, but I am getting a bunch of data that I am not interested in, and some of the data that I want is missing in the response.
The response I get contains the following fields:
“sum_daily_exit_nb_uniq_visitors”
“nb_hits_following_search”
“sum_time_spent”
“bounce_rate”
“label”
“sum_daily_nb_uniq_visitors”
“entry_nb_actions”
“sum_daily_entry_nb_uniq_visitors”
“url”
“entry_nb_visits”
“entry_sum_visit_length”
“avg_time_on_page”
“nb_visits”
“nb_hits”
“entry_bounce_count”
“exit_nb_visits”
“exit_rate”
I am only interested in:
“url”
“nb_visits”
and I want to split up the data somehow to show “browserCode” and “countryCode” - if possible.
I’m not sure how that would work in reality. Maybe splitting on just “browserCode” to begin with is good enough. For instance, I make the request and the response contains a bunch of JSON-arrays (one for each browserCode) with data such as:
-The users in this array used the Google Chrome browser
-Number of visits: 32
-URL: x (same as below)
-The users in this array used the Internet Explorer browser
-Number of visits: 2
-URL: x (same as above)
etc.
Is this possible, and if so: how?
Thanks in advance.