blob: 7ce6eeabdab7210ef625017d5447e8fcb4623f20 [file] [log] [blame]
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visitssummary.R
\name{getVisitsSummary}
\alias{getVisitsSummary}
\title{Get visits summary from matomo API server}
\usage{
getVisitsSummary(
matomoUrl,
siteId,
period = "month",
date = "last16",
filter_limit = 100,
removeFirst = FALSE,
removeLast = FALSE,
accessToken = getAccessToken(matomoUrl)
)
}
\arguments{
\item{matomoUrl}{base URL of your matomo instance}
\item{siteId}{matomo site id or vector of site ids}
\item{period}{\code{day}, \code{week}, \code{month} or \code{year}}
\item{date}{date range (see \url{https://developer.matomo.org/api-reference/reporting-api})}
\item{filter_limit}{defines the maximum number of rows to be returned}
\item{removeFirst}{logical that determines whether the first row of each site should be removed (to account for incomplete periods)}
\item{removeLast}{logical that determines whether the last row of each site should be removed (to account for incomplete periods)}
\item{accessToken}{API Authentication Token - you can get this in your
matomo interface under Settings -> Personal -> Settings -> API Authentication Token
and pass it here, or you can make it persistent with \code{\link{persistAccessToken}}.}
}
\value{
Data frame with visits summary as returned by matomo. Note that the \code{date} column in the returned data frame refers to the first day of the respective period.
}
\description{
See matomo Reporting API Reference (\url{https://developer.matomo.org/api-reference/reporting-api}) for details.
}
\examples{
\dontrun{
df <- getVisitsSummary("https://demo.matomo.org/", siteId=3, period="day", date="last60")
plot(df$nb_actions ~ df$date, type="b")
}
}
\references{
\url{https://developer.matomo.org/api-reference/reporting-api}
}