## Not run:
# library(googleAnalyticsR)
#
# ## authenticate,
# ## or use the RStudio Addin "Google API Auth" with analytics scopes set
# ga_auth()
#
# ## get your accounts
# account_list <- google_analytics_account_list()
#
# ## pick a profile with data to query
#
# ga_id <- account_list[23,'viewId']
#
# ga_req1 <- make_ga_4_req(ga_id,
# date_range = c("2015-07-30","2015-10-01"),
# dimensions=c('source','medium'),
# metrics = c('sessions'))
#
# ga_req2 <- make_ga_4_req(ga_id,
# date_range = c("2015-07-30","2015-10-01"),
# dimensions=c('source','medium'),
# metrics = c('users'))
#
# fetch_google_analytics_4(list(ga_req1, ga_req2))
#
# ## End(Not run)
Run the code above in your browser using DataLab