blob: 79bc6762a5dc331014bc2d5afbaa268453e298b6 [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",
Marc Kupietz0ec50522022-04-09 15:53:24 +020012 filter_limit = 500,
Marc Kupietza93a2722021-04-28 12:22:45 +020013 removeFirst = FALSE,
14 removeLast = FALSE,
15 accessToken = getAccessToken(matomoUrl),
Marc Kupietz71c89752023-07-28 15:58:12 +020016 getMethod = "VisitsSummary.get",
17 ignoreEmptyResult = FALSE
Marc Kupietza93a2722021-04-28 12:22:45 +020018)
19}
20\arguments{
21\item{matomoUrl}{base URL of your matomo instance}
22
23\item{siteId}{matomo site id or vector of site ids}
24
25\item{period}{\code{day}, \code{week}, \code{month} or \code{year}}
26
27\item{date}{date range (see \url{https://developer.matomo.org/api-reference/reporting-api})}
28
29\item{filter_limit}{defines the maximum number of rows to be returned}
30
31\item{removeFirst}{logical that determines whether the first row of each site should be removed (to account for incomplete periods)}
32
33\item{removeLast}{logical that determines whether the last row of each site should be removed (to account for incomplete periods)}
34
35\item{accessToken}{API Authentication Token - you can get this in your
36matomo interface under Settings -> Personal -> Settings -> API Authentication Token
37and pass it here, or you can make it persistent with \code{\link{persistAccessToken}}.}
38
39\item{getMethod}{API method to call – default: VisitsSummary.get}
Marc Kupietz71c89752023-07-28 15:58:12 +020040
41\item{ignoreEmptyResult}{if FALSE stop with error message on empty list results, otherwise return empty list}
Marc Kupietza93a2722021-04-28 12:22:45 +020042}
43\value{
44Data 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.
45}
46\description{
47See matomo Reporting API Reference (\url{https://developer.matomo.org/api-reference/reporting-api}) for details.
48}
49\examples{
50\dontrun{
51df <- matomoQuery("https://demo.matomo.org/", getMethod = "UserCountry.getCountry")
52}
53
54}
55\references{
56\url{https://developer.matomo.org/api-reference/reporting-api}
57}