Learn R Programming

RSiteCatalyst (version 1.4.10)

QueueDataWarehouse: Queue a DataWarehouse Report

Description

A QueueDataWarehouse report is a report where metrics are retrieved, broken down by an unlimited number of elements such as page, eVar, prop, etc, and with or without temporal aggregation. Due API limitations, only one segment can be used if needed.

Usage

QueueDataWarehouse(reportsuite.id, date.from, date.to, metrics, elements, date.granularity = "day", segment.id = "", data.current = TRUE, expedite = FALSE, interval.seconds = 5, max.attempts = 120, validate = TRUE, enqueueOnly = TRUE, ftp = ftp)

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
date.granularity
Time granularity of the report (year/month/week/day/hour), default to 'day'
segment.id
Id of Adobe Analytics segment to retrieve the report for
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
Weather 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
ftp
FTP client parameters, only used if enqueueOnly=TRUE. Double check ftp parameters before requesting a long report.

Value

Data frame or report id, if enqueueOnly is TRUE

Details

The QueueDataWarehouse function allows to access to Data WareHouse data and returns either a json or send a csv to a ftp server.

Because of the Reporting API structure, this function requests the report, then, if enqueueOnly=FALSE, checks the reporting queue to see if the report is completed, and when the report returns as "done" pulls the report from the API (if ftp is not defined). This checking process will occur up to the specified number of times (default 120), with a delay between status checks (default 10 seconds). If the report does not return as "done" or a "delivery_complete" after the number of tries have completed, the function will return an error message. When enqueueOnly=TRUE and no ftp server is set, the report can be retrieved with Report.Get using the reportId returned by the QueueDataWarehouse function.

API limitations: A single segment is supported. Multiple segments are not supported. The following element properties are not supported in Data Warehouse reports: - selected - search - top - startingWith - sortBy Calculated metrics are not supported. Results for data warehouse reports can be accessed in two ways: directly through the API and through FTP delivery. Email delivery is not supported. All data warehouse results are paged in chunks of 20 MB. Add "page": to Report.Get to determine the page returned. If no page is specified then the first page is returned.

Examples

Run this code
## Not run: 
# report.data <- QueueDataWarehouse("your_report_suite",
#                             "2014-01-01",
#                             "2014-01-07",
#                             c("visits", "pageviews","event10"),
#                             c("page","geoCountry","geoCity"),
#                             enqueueOnly=TRUE,
#                             ftp = list(host = "myftpserver.com",
#                                        port = "21",
#                                        directory = "/fromDW/",
#                                        username = "memyselfandirene",
#                                        password = "valkilmer",
#                                        filename = "myreport.csv")
#                             )
# ## End(Not run)

Run the code above in your browser using DataLab