This is the equivalent of a freeform table with segments as the row
components. This type of table offers a few components that
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.
aw_segment_table( company_id = Sys.getenv("AW_COMPANY_ID"), rsid = Sys.getenv("AW_REPORTSUITE_ID"), date_range = c(Sys.Date() - 30, Sys.Date() - 1), metrics = c("visits", "visitors"), globalSegment = NULL, segmentIds = NULL, debug = FALSE )
Metrics to request for each segment
One or more segments to apply globally over all other segments
One or more segments that will compose the rows of the table
Logical, whether to make verbose requests to the API and view the whole exchange
tibble::tibble() of segments and metrics. Rows are returned with
segments in the order they were requested, not by metric sorting.
This is a specialized function.
To see segments broken down by dimensions, we recommend making multiple
aw_freeform_table with different global segments applied, and
then row-binding them together yourself.
aw_freeform_table, this function automatically handles the 10-metric
restriction imposed by the API.
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.
The function does not currently support segment breakdowns, but you can stack segments by applying a global segment to your query.