Obtain access to the Metadata API

knitr::opts_chunk$set(
    comment = "#>",
    collapse = TRUE,
    error = FALSE,
    tidy = FALSE
)

When working with the API reports it is sometimes necessary to obtain background information about these or other query parameters to the API. To obtain a list of all the metrics and dimensions RGA package provides the list_dimsmets() function, which return actual informtation about all dimensions and metrics for the given report type (now support only the Core Reporting API metadata).

list_dimsmets() return an data.frame, which consists of the following columns:

There are several examples of usage the metadata Google Analytics API.

Examples

To obtain the relevant information metadata:

ga_meta <- list_dimsmets()

List of all outdated parameters and those ones which were replaced:

subset(ga_meta, status == "DEPRECATED", c(id, replacedBy.by))

List of all parameters from certain group:

subset(ga_meta, group == "Traffic Sources", c(id, type))

List of all calculated parameters:

subset(ga_meta, !is.na(calculation), c(id, calculation))

List of all parameters allowed in segments:

subset(ga_meta, allowedInSegments, id)

List of all templatized parameters:

subset(ga_meta, !is.na(minTemplateIndex) & !is.na(maxTemplateIndex), id)

References



Try the RGA package in your browser

Any scripts or data that you put into this service are public.

RGA documentation built on May 2, 2019, 6:47 a.m.