fetch_google_analytics_4: Fetch multiple GAv4 requests

Description Usage Arguments Details Value See Also Examples

View source: R/ga_v4_get.R

Description

Fetch the GAv4 requests as created by make_ga_4_req

Usage

1

Arguments

request_list

A list of requests created by make_ga_4_req

merge

If TRUE then will rbind that list of data.frames

Details

For same viewId, daterange, segments, samplingLevel and cohortGroup, v4 batches can be made

Value

A dataframe if one request, or a list of data.frames if multiple.

See Also

Other GAv4 fetch functions: google_analytics_4, make_ga_4_req

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## 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)

GeeHLee/GoogleR documentation built on May 6, 2019, 5:34 p.m.