blob: c1f517d0c937ac5d9b359ee2393379d35405a181 [file] [log] [blame]
Marc Kupietzb74649f2020-12-11 12:44:49 +01001#' 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 Kupietza93a2722021-04-28 12:22:45 +02007#' @inheritParams matomoQuery
Marc Kupietzb74649f2020-12-11 12:44:49 +01008#'
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
16getVisitsSummary <- 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 Kupietzb74649f2020-12-11 12:44:49 +010024) {
Marc Kupietza93a2722021-04-28 12:22:45 +020025 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 Kupietzb74649f2020-12-11 12:44:49 +010033}