Template:GetMatomo
From BASAntb Wiki
Matomo API[edit source]
- https://developer.matomo.org/api-reference/reporting-api#VisitsSummary
- Call example (replace TOKEN_HERE with a token) https://dictionary.basabali.org/matomo/index.php?module=API&method=VisitsSummary.get&idSite=2&period=day&date=yesterday&format=JSON&force_api_session=1&token_auth=TOKEN_HERE
- Metrics definitions: https://developer.matomo.org/api-reference/reporting-api#api-response-metric-definitions
Examples[edit source]
- Get number of visitors yesterday: URL https://dictionary.basabali.org/matomo/index.php?module=API&method=VisitsSummary.get&idSite=2&period=day&date=yesterday&format=JSON&token_auth=MATOMO_APIKEY&force_api_session=1 is not allowed on this wiki.Error: no local variable "nb_visits" has been set.
- Unique: URL https://dictionary.basabali.org/matomo/index.php?module=API&method=VisitsSummary.get&idSite=2&period=day&date=yesterday&format=JSON&token_auth=MATOMO_APIKEY&force_api_session=1 is not allowed on this wiki.Error: no local variable "nb_uniq_visitors" has been set.
- Actions: URL https://dictionary.basabali.org/matomo/index.php?module=API&method=VisitsSummary.get&idSite=2&period=day&date=yesterday&format=JSON&token_auth=MATOMO_APIKEY&force_api_session=1 is not allowed on this wiki.Error: no local variable "nb_actions" has been set.
- Get number of visitors this month: URL https://dictionary.basabali.org/matomo/index.php?module=API&method=VisitsSummary.get&idSite=2&period=month&date=today&format=JSON&token_auth=MATOMO_APIKEY&force_api_session=1 is not allowed on this wiki.Error: no local variable "nb_visits" has been set.
- Unique: URL https://dictionary.basabali.org/matomo/index.php?module=API&method=VisitsSummary.get&idSite=2&period=month&date=today&format=JSON&token_auth=MATOMO_APIKEY&force_api_session=1 is not allowed on this wiki.Error: no local variable "nb_uniq_visitors" has been set.
- Actions: URL https://dictionary.basabali.org/matomo/index.php?module=API&method=VisitsSummary.get&idSite=2&period=month&date=today&format=JSON&token_auth=MATOMO_APIKEY&force_api_session=1 is not allowed on this wiki.Error: no local variable "nb_actions" has been set.
- Get number of visitors specific day (2022-01-01): URL https://dictionary.basabali.org/matomo/index.php?module=API&method=VisitsSummary.get&idSite=2&period=day&date=2022-01-01&format=JSON&token_auth=MATOMO_APIKEY&force_api_session=1 is not allowed on this wiki.Error: no local variable "nb_visits" has been set.
- Get number of visitors specific range (2022-01-01 to 2022-01-21): URL https://dictionary.basabali.org/matomo/index.php?module=API&method=VisitsSummary.get&idSite=2&period=range&date=2022-01-01,2022-01-21&format=JSON&token_auth=MATOMO_APIKEY&force_api_session=1 is not allowed on this wiki.Error: no local variable "nb_visits" has been set.
- Get total number of visits for a year: URL https://dictionary.basabali.org/matomo/index.php?module=API&method=VisitsSummary.get&idSite=2&period=year&date=2022&format=JSON&token_auth=MATOMO_APIKEY&force_api_session=1 is not allowed on this wiki.Error: no local variable "nb_visits" has been set.
- Get total number of page views for a year: URL https://dictionary.basabali.org/matomo/index.php?module=API&method=MultiSites.getOne&idSite=2&period=year&date=2022&format=JSON&token_auth=MATOMO_APIKEY&force_api_session=1 is not allowed on this wiki.Error: no local variable "nb_pageviews" has been set.