Description Usage Arguments Value References See Also Examples
Get the Anaytics data from Real Time Reporting API for a view (profile).
1 2 3 |
profileId |
character. Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. Can be obtained using the |
metrics |
character. A comma-separated list of real time metrics. E.g., |
dimensions |
character. A comma-separated list of real time dimensions. E.g., |
sort |
character. A comma-separated list of dimensions or metrics that determine the sort order for real time data. |
filters |
character. A comma-separated list of dimension or metric filters to be applied to real time data. |
max.results |
integer. The maximum number of entries to include in this feed. |
token |
|
A data frame including the real time data for a view (profile). Addition information about profile and request query stored in the attributes.
Real Time Reporting API - Dimensions & Metrics Reference
Other Reporting API: firstdate
,
get_ga
, get_mcf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
# get token data
authorize()
# get report data
ga_data <- get_realtime(XXXXXXX, metrics = "rt:activeUsers",
dimensions = "rt:source,rt:medium")
# get active users in realtime (press Esc to abort)
while (TRUE) {
cat("\014")
print(get_realtime(XXXXXXX, metrics = "rt:activeUsers"))
Sys.sleep(2)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.