Rainer Feike
Rainer Feike

Reputation: 191

Get all-time-impressions for given contentName in Matomo Reporting API

I'd like to request the core metrics for a given contentName in matomos reporting API. ContentName is in this example anwalt:4247, and I send this request:

https://statistics/?method=Contents.getContentNames&segment=contentName==anwalt:4247&label=anwalt:4247&date=2019-01-01,today&period=range&format=JSON&module=API&idSite=1&format=JSON&token_auth=93exx3

gives

[{"label":"anwalt:4247","nb_visits":27,"nb_impressions":37,"nb_interactions":12,"sum_daily_nb_uniq_visitors":27,"interaction_rate":"32,43\u00a0%","segment":"contentName==anwalt%3A4247","idsubdatatable":1}]

or this

https://statistics/?method=Contents.getContentNames&label=anwalt:4247&date=2019-01-01,today&period=range&format=JSON&module=API&idSite=1&format=JSON&token_auth=93exx3

gives

[{"label":"anwalt:4247","nb_visits":21,"nb_impressions":28,"nb_interactions":8,"sum_daily_nb_uniq_visitors":21,"interaction_rate":"28,57\u00a0%","segment":"contentName==anwalt%3A4247","idsubdatatable":282}]

But both numbers are wrong (other than in matomo UI).

Isn't there any simple request for that common task?

Upvotes: 0

Views: 52

Answers (1)

mattab
mattab

Reputation: 369

What you tried with &date=2019-01-01,today&period=range should work fine, what is the problem in the output data?

Upvotes: 0

Related Questions