Learn R Programming

googleAnalyticsR (version 0.5.0)

anti_sample: Get a GA request with anti-sampling

Description

Calculates multiple API calls to avoid sampling

Usage

anti_sample(anti_sample_batches, viewId, date_range, metrics, dimensions,
  dim_filters, met_filters, filtersExpression, order, segments, pivots, cohorts,
  metricFormat, histogramBuckets, slow_fetch, rows_per_call)

Arguments

anti_sample_batches

"auto" default, or set to number of days per batch. 1 = daily.

viewId

viewId of data to get.

date_range

character or date vector of format c(start, end) or for two date ranges: c(start1,end1,start2,end2)

metrics

Metric to fetch. Supports calculated metrics.

dimensions

Dimensions to fetch.

dim_filters
met_filters
filtersExpression

A v3 API style simple filter string. Not used with other filters.

order

An order_type object

segments

List of segments as created by segment_ga4

pivots

Pivots of the data as created by pivot_ga4

cohorts

Cohorts created by make_cohort_group

metricFormat

If supplying calculated metrics, specify the metric type

histogramBuckets

For numeric dimensions such as hour, a list of buckets of data. See details in make_ga_4_req

slow_fetch

For large, complicated API requests this bypasses some API hacks that may result in 500 errors. For smaller queries, leave this as FALSE for quicker data fetching.

rows_per_call

Set how many rows are requested by the API per call, up to a maximum of 100000.