blob: 9eb363808842d80705eafd0cd104e1c005513269 [file] [log] [blame]
#' 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
#'
#' @examples
#' \dontrun{
#' df <- getUserCountry("https://demo.matomo.org/", siteId=3, period="day", date="last60")
#' }
#'
#' @export
getUserCountry <- function(matomoUrl,
siteId,
period = "month",
date = "last36",
filter_limit = 100,
accessToken = getAccessToken(matomoUrl)
) {
matomoQuery(matomoUrl = matomoUrl,
siteId = siteId,
period = period,
date = date,
removeFirst = FALSE,
removeLast = FALSE,
accessToken = accessToken,
getMethod = "UserCountry.getCountry")
}