Marc Kupietz | b74649f | 2020-12-11 12:44:49 +0100 | [diff] [blame] | 1 | #' Get visits summary 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 | #' |
Marc Kupietz | a93a272 | 2021-04-28 12:22:45 +0200 | [diff] [blame^] | 7 | #' @inheritParams matomoQuery |
Marc Kupietz | b74649f | 2020-12-11 12:44:49 +0100 | [diff] [blame] | 8 | #' |
| 9 | #' @examples |
| 10 | #' \dontrun{ |
| 11 | #' df <- getVisitsSummary("https://demo.matomo.org/", siteId=3, period="day", date="last60") |
| 12 | #' plot(df$nb_actions ~ df$date, type="b") |
| 13 | #' } |
| 14 | #' |
| 15 | #' @export |
| 16 | getVisitsSummary <- function(matomoUrl, |
| 17 | siteId, |
| 18 | period = "month", |
| 19 | date = "last16", |
| 20 | filter_limit = 100, |
| 21 | removeFirst = FALSE, |
| 22 | removeLast = FALSE, |
| 23 | accessToken = getAccessToken(matomoUrl) |
Marc Kupietz | b74649f | 2020-12-11 12:44:49 +0100 | [diff] [blame] | 24 | ) { |
Marc Kupietz | a93a272 | 2021-04-28 12:22:45 +0200 | [diff] [blame^] | 25 | matomoQuery(matomoUrl = matomoUrl, |
| 26 | siteId = siteId, |
| 27 | period = period, |
| 28 | date = date, |
| 29 | removeFirst = removeFirst, |
| 30 | removeLast = removeLast, |
| 31 | accessToken = accessToken, |
| 32 | getMethod = "VisitsSummary.get") |
Marc Kupietz | b74649f | 2020-12-11 12:44:49 +0100 | [diff] [blame] | 33 | } |