blob: 87501c11308c8f5e5049c7e55aac329d238b84b9 [file] [log] [blame]
Marc Kupietza93a2722021-04-28 12:22:45 +02001% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/matomoquery.R
3\name{matomoQuery}
4\alias{matomoQuery}
5\title{Get reports from a matomo API server}
6\usage{
7matomoQuery(
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 getMethod = "VisitsSummary.get"
17)
18}
19\arguments{
20\item{matomoUrl}{base URL of your matomo instance}
21
22\item{siteId}{matomo site id or vector of site ids}
23
24\item{period}{\code{day}, \code{week}, \code{month} or \code{year}}
25
26\item{date}{date range (see \url{https://developer.matomo.org/api-reference/reporting-api})}
27
28\item{filter_limit}{defines the maximum number of rows to be returned}
29
30\item{removeFirst}{logical that determines whether the first row of each site should be removed (to account for incomplete periods)}
31
32\item{removeLast}{logical that determines whether the last row of each site should be removed (to account for incomplete periods)}
33
34\item{accessToken}{API Authentication Token - you can get this in your
35matomo interface under Settings -> Personal -> Settings -> API Authentication Token
36and pass it here, or you can make it persistent with \code{\link{persistAccessToken}}.}
37
38\item{getMethod}{API method to call – default: VisitsSummary.get}
39}
40\value{
41Data 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.
42}
43\description{
44See matomo Reporting API Reference (\url{https://developer.matomo.org/api-reference/reporting-api}) for details.
45}
46\examples{
47\dontrun{
48df <- matomoQuery("https://demo.matomo.org/", getMethod = "UserCountry.getCountry")
49}
50
51}
52\references{
53\url{https://developer.matomo.org/api-reference/reporting-api}
54}