| #' Get user country report from matomo API server |
| #' See matomo Reporting API Reference (\url{https://developer.matomo.org/api-reference/reporting-api}) for details. |
| #' @references \url{https://developer.matomo.org/api-reference/reporting-api} |
| #' @inheritParams matomoQuery |
| #' @importFrom stringr str_replace str_replace_all |
| #' df <- getUserCountry("https://demo.matomo.org/", siteId=3, period="day", date="last60") |
| getUserCountry <- function(matomoUrl, |
| accessToken = getAccessToken(matomoUrl) |
| matomoQuery(matomoUrl = matomoUrl, |
| date = str_replace_all(str_replace_all(date, " *UTC", ""), "-00", "-01"), |
| accessToken = accessToken, |
| getMethod = "UserCountry.getCountry") |