aw_segment_table: Get a segment-row freeform table

View source: R/freeform_segments.R

aw_segment_tableR Documentation

Get a segment-row freeform table

Description

This is the equivalent of a freeform table with segments as the row components. This type of table offers a few components that aw_freeform_table does not. For example, this function does not require (or allow) dimensions to be included in the breakdown. Segment IDs are automatically translated into their human-readable names.

Usage

aw_segment_table(
  company_id = Sys.getenv("AW_COMPANY_ID"),
  rsid = Sys.getenv("AW_REPORTSUITE_ID"),
  segmentRsids,
  date_range = c(Sys.Date() - 30, Sys.Date() - 1),
  metrics = c("visits", "visitors"),
  globalSegment = NULL,
  segmentIds = NULL,
  debug = FALSE
)

Arguments

company_id

Company ID

rsid

Report suite ID for the data pull

segmentRsids

Deprecated.

date_range

Date range

metrics

Metrics to request for each segment

globalSegment

One or more segments to apply globally over all other segments

segmentIds

One or more segments that will compose the rows of the table

debug

Logical, whether to make verbose requests to the API and view the whole exchange

Details

This is a specialized function. To see segments broken down by dimensions, we recommend making multiple requests to aw_freeform_table with different global segments applied, and then row-binding them together yourself.

Unlike aw_freeform_table, this function automatically handles the 10-metric restriction imposed by the API.

Efficiency

In short, segments are cheap, metrics are expensive. Adding 1 metric is the equivalent of adding 10 segments, judging by the number of requests necessary to collect the data.

Stacking segments

The function does not currently support segment breakdowns, but you can stack segments by applying a global segment to your query.

Value

tibble::tibble() of segments and metrics. Rows are returned with segments in the order they were requested, not by metric sorting.

See Also

aw_freeform_table()


adobeanalyticsr documentation built on Nov. 9, 2023, 5:07 p.m.