Marc Kupietz | a93a272 | 2021-04-28 12:22:45 +0200 | [diff] [blame] | 1 | #' 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 |
| 15 | getUserCountry <- 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 | } |