ga_comparison_data: Get Google Analytics Comparison Data

Description Usage Arguments Value

View source: R/ga_comparison_data.R

Description

A wrapper function around googleAnalyticsR::google_analytics() that returns a list with data from three time periods: the time period requested by date_range, the time period 1 year prior to date_range and the time period immediately preceding date_range.

Usage

1
2
3
ga_comparison_data(viewId, date_range = c(Sys.Date(), Sys.Date() - 1),
  metrics = c("users", "newUsers"), dimensions = c("date",
  "deviceCategory"), anti_sample = TRUE)

Arguments

viewId

The ID of the Google Analytics View to retrieve data from.

date_range

The date range to retrieve data from. Takes a vector of two dates with the format "YYYY-MM-DD"

metrics

Metrics to retrieve from Google Analytics

dimensions

Dimensions to retrieve from Google Analytics

anti_sample

Set to TRUE to disallow sampling.

Value

A list object with data for the current date range, the same date range 1 year prior, and the previous period.


niedermansam/marketR documentation built on Nov. 4, 2019, 10:06 p.m.