QueueRanked: Run a Ranked Report

Description Usage Arguments Details Value Examples

View source: R/QueueRanked.R

Description

A QueueRanked report is a report that shows the ranking of values for one or more elements relative to a metric, aggregated over the time period selected.

Usage

1
2
3
4
5
QueueRanked(reportsuite.id, date.from, date.to, metrics, elements, top = 10,
  start = 1, selected = c(), search = c(), search.type = "or",
  segment.id = "", segment.inline = "", classification = c(),
  data.current = FALSE, expedite = FALSE, interval.seconds = 5,
  max.attempts = 120, validate = TRUE, enqueueOnly = FALSE)

Arguments

reportsuite.id

Report suite id

date.from

Start date for the report (YYYY-MM-DD)

date.to

End date for the report (YYYY-MM-DD)

metrics

List of metrics to include in the report

elements

List of elements to include in the report

top

List of numbers to limit the number of rows to include (top X). eg. c(10,5)

start

Start row if you do not want to start at #1 - only applies to the first element.

selected

List of specific items (of the first element) to include in the report - e.g. c("www:home","www:search","www:about"). this only works for the first element (API limitation).

search

List of keywords for the first specified element - e.g. c("contact","about","shop"). search overrides anything specified using selected

search.type

String specifying the search type: 'and', or, 'or' 'not' (defaults to 'or')

segment.id

Id(s) of Adobe Analytics segment to retrieve the report for

segment.inline

Inline segment definition

classification

SAINT classification to use in place of first element. Need to specify element AND classification.

data.current

TRUE or FALSE - whether to include current data for reports that include today's date

expedite

Set to TRUE to expedite the processing of this report

interval.seconds

How long to wait between attempts

max.attempts

Number of API attempts before stopping

validate

whether to submit report definition for validation before requesting the data.

enqueueOnly

only enqueue the report, don't get the data. returns report id, which you can later use to get the data

Details

The QueueRanked function returns a data frame equivalent to pulling a Ranked report in Adobe Reports & Analytics. Correlations & Sub-Relations are supported.

Because of the Reporting API structure, this function first requests the report, then checks the reporting queue to see if the report is completed, and when the report returns as "done" pulls the report from the API. This checking process will occur up to the specified number of times (default 120), with a delay between status checks (default 5 seconds). If the report does not return as "done" after the number of tries have completed, the function will return an error message.

Note: Because of the multiple argument types ("top" and "start" OR "selected"), keyword arguments are generally needed towards the end of the function call instead of just positional arguments.

Value

Data frame

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: 

ranked1 <- QueueRanked("your_report_suite",
                       date.from = "2014-04-01",
                       date.to = "2014-04-20",
                       metrics = "pageviews",
                       elements = c("sitesection", "page")
                       )
                       
 ranked2 <- QueueRanked(
                       reportsuite.id = your_report_suite, 
                       date.from = "2016-03-30", 
                       date.to = "2016-03-30",
                       metrics = "orders",
                       elements = "product",
                       classification = "Product Group"
                       )
 enqueued.report.id <- QueueRanked(
                       reportsuite.id = your_report_suite, 
                       date.from = "2016-03-30", 
                       date.to = "2016-03-30",
                       metrics = "orders",
                       elements = "product",
                       classification = "Product Group",
                       enqueueOnly = TRUE
                       )

## End(Not run)

RSiteCatalyst documentation built on Nov. 6, 2019, 5:09 p.m.