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", |
| 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 |
| 35 | matomo interface under Settings -> Personal -> Settings -> API Authentication Token |
| 36 | and 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{ |
| 41 | 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. |
| 42 | } |
| 43 | \description{ |
| 44 | See matomo Reporting API Reference (\url{https://developer.matomo.org/api-reference/reporting-api}) for details. |
| 45 | } |
| 46 | \examples{ |
| 47 | \dontrun{ |
| 48 | df <- matomoQuery("https://demo.matomo.org/", getMethod = "UserCountry.getCountry") |
| 49 | } |
| 50 | |
| 51 | } |
| 52 | \references{ |
| 53 | \url{https://developer.matomo.org/api-reference/reporting-api} |
| 54 | } |