blob: 7ce6eeabdab7210ef625017d5447e8fcb4623f20 [file] [log] [blame]
Marc Kupietzb74649f2020-12-11 12:44:49 +01001% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/visitssummary.R
3\name{getVisitsSummary}
4\alias{getVisitsSummary}
5\title{Get visits summary from matomo API server}
6\usage{
7getVisitsSummary(
8 matomoUrl,
9 siteId,
10 period = "month",
11 date = "last16",
12 filter_limit = 100,
13 removeFirst = FALSE,
14 removeLast = FALSE,
15 accessToken = getAccessToken(matomoUrl)
16)
17}
18\arguments{
19\item{matomoUrl}{base URL of your matomo instance}
20
21\item{siteId}{matomo site id or vector of site ids}
22
23\item{period}{\code{day}, \code{week}, \code{month} or \code{year}}
24
25\item{date}{date range (see \url{https://developer.matomo.org/api-reference/reporting-api})}
26
27\item{filter_limit}{defines the maximum number of rows to be returned}
28
29\item{removeFirst}{logical that determines whether the first row of each site should be removed (to account for incomplete periods)}
30
Marc Kupietz7d4149f2020-12-14 08:41:45 +010031\item{removeLast}{logical that determines whether the last row of each site should be removed (to account for incomplete periods)}
Marc Kupietzb74649f2020-12-11 12:44:49 +010032
33\item{accessToken}{API Authentication Token - you can get this in your
Marc Kupietz7d4149f2020-12-14 08:41:45 +010034matomo interface under Settings -> Personal -> Settings -> API Authentication Token
35and pass it here, or you can make it persistent with \code{\link{persistAccessToken}}.}
Marc Kupietzb74649f2020-12-11 12:44:49 +010036}
37\value{
Marc Kupietz7d4149f2020-12-14 08:41:45 +010038Data 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.
Marc Kupietzb74649f2020-12-11 12:44:49 +010039}
40\description{
41See matomo Reporting API Reference (\url{https://developer.matomo.org/api-reference/reporting-api}) for details.
42}
43\examples{
44\dontrun{
45df <- getVisitsSummary("https://demo.matomo.org/", siteId=3, period="day", date="last60")
46plot(df$nb_actions ~ df$date, type="b")
47}
48
49}
50\references{
51\url{https://developer.matomo.org/api-reference/reporting-api}
52}