blob: 9eb363808842d80705eafd0cd104e1c005513269 [file] [log] [blame]
Marc Kupietza93a2722021-04-28 12:22:45 +02001#' Get user country report from matomo API server
2#'
3#' See matomo Reporting API Reference (\url{https://developer.matomo.org/api-reference/reporting-api}) for details.
4#'
5#' @references \url{https://developer.matomo.org/api-reference/reporting-api}
6#'
7#' @inheritParams matomoQuery
8#'
9#' @examples
10#' \dontrun{
11#' df <- getUserCountry("https://demo.matomo.org/", siteId=3, period="day", date="last60")
12#' }
13#'
14#' @export
15getUserCountry <- function(matomoUrl,
16 siteId,
17 period = "month",
18 date = "last36",
19 filter_limit = 100,
20 accessToken = getAccessToken(matomoUrl)
21) {
22 matomoQuery(matomoUrl = matomoUrl,
23 siteId = siteId,
24 period = period,
25 date = date,
26 removeFirst = FALSE,
27 removeLast = FALSE,
28 accessToken = accessToken,
29 getMethod = "UserCountry.getCountry")
30}