Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ga_data_aggregations

Extract metric aggregations from a ga_data result


Description

[Experimental]

Metric aggregations are available in all requests. This function lets you easily access the data.frames

Usage

ga_data_aggregations(
  df,
  type = c("all", "totals", "maximums", "minimums", "count")
)

Arguments

df

A data.frame result from ga_data

type

totals, maximums, minimums, counts (if available) or all

Examples

## Not run: 
#' # send up to 4 date ranges
multi_date <- ga_data(
  206670707,
  metrics = c("activeUsers","sessions"),
  dimensions = c("date","city","dayOfWeek"),
  date_range = c("2020-03-31", "2020-04-27", "2020-04-30", "2020-05-27"),
  dim_filters = ga_data_filter("city"=="Copenhagen"),
  limit = 100
  )

# metric aggregations for each date range
ga_data_aggregations(multi_date, type = "all")

# specify type
ga_data_aggregations(multi_date, type = "maximums")


## End(Not run)

googleAnalyticsR

Google Analytics API into R

v1.0.0
MIT + file LICENSE
Authors
Mark Edmondson [aut, cre] (<https://orcid.org/0000-0002-8434-3881>), Artem Klevtsov [ctb], Johann deBoer [ctb], David Watkins [ctb], Olivia Brode-Roger [ctb], Jas Sohi [ctb], Zoran Selinger [ctb], Octavian Corlade [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.