Marc Kupietz | a93a272 | 2021-04-28 12:22:45 +0200 | [diff] [blame] | 1 | % 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{ |
| 7 | matomoQuery( |
| 8 | matomoUrl, |
| 9 | siteId, |
| 10 | period = "month", |
| 11 | date = "last16", |
Marc Kupietz | 0ec5052 | 2022-04-09 15:53:24 +0200 | [diff] [blame] | 12 | filter_limit = 500, |
Marc Kupietz | a93a272 | 2021-04-28 12:22:45 +0200 | [diff] [blame] | 13 | removeFirst = FALSE, |
| 14 | removeLast = FALSE, |
| 15 | accessToken = getAccessToken(matomoUrl), |
Marc Kupietz | 71c8975 | 2023-07-28 15:58:12 +0200 | [diff] [blame] | 16 | getMethod = "VisitsSummary.get", |
| 17 | ignoreEmptyResult = FALSE |
Marc Kupietz | a93a272 | 2021-04-28 12:22:45 +0200 | [diff] [blame] | 18 | ) |
| 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 |
| 36 | matomo interface under Settings -> Personal -> Settings -> API Authentication Token |
| 37 | and 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 Kupietz | 71c8975 | 2023-07-28 15:58:12 +0200 | [diff] [blame] | 40 | |
| 41 | \item{ignoreEmptyResult}{if FALSE stop with error message on empty list results, otherwise return empty list} |
Marc Kupietz | a93a272 | 2021-04-28 12:22:45 +0200 | [diff] [blame] | 42 | } |
| 43 | \value{ |
| 44 | 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. |
| 45 | } |
| 46 | \description{ |
| 47 | See matomo Reporting API Reference (\url{https://developer.matomo.org/api-reference/reporting-api}) for details. |
| 48 | } |
| 49 | \examples{ |
| 50 | \dontrun{ |
| 51 | df <- matomoQuery("https://demo.matomo.org/", getMethod = "UserCountry.getCountry") |
| 52 | } |
| 53 | |
| 54 | } |
| 55 | \references{ |
| 56 | \url{https://developer.matomo.org/api-reference/reporting-api} |
| 57 | } |