Learn R Programming

shinyga (version 0.1.2.9001)

MEgetData: MEgetData - does the actual fetch of GA data, called from rollupGA

Description

An internal function called from rollupGA, this does the actual fetch from GA.

Usage

MEgetData(ids, start.date = format(Sys.time(), "%Y-%m-%d"), end.date = format(Sys.time(), "%Y-%m-%d"), metrics = "ga:visits", dimensions = "ga:date", sort = "", filters = "", segment = "", fields = "", start = 1, max, date.format = "%Y-%m-%d", messages = TRUE, batch, walk = FALSE, output.raw, output.formats, return.url = FALSE, rbr = FALSE, envir = .GlobalEnv, token)

Arguments

ids
The view ID
start.date
Start date of data fetch
end.date
End date of data fetch
metrics
Metrics called, in GA API format (e.g. ga:visits,ga:pageviews)
dimensions
Dimensions called, in GA API format (e.g. ga:date, ga:source)
sort
Sort the results before returning data
filters
Filters of data
segment
Any segments
fields
What fields from the API should be returned
start
What start index of the data, used for walking through big results
max
Maximum number of results to fetch
date.format
Date format of results
messages
Feedback messages
batch
If results over 10000 limit, whether to batch them
walk
If results are sampled, whether to do daily fetches to avoid sampling
output.raw
Whether the results should be outputed not parsed into data.frame
output.formats
Formats of data output
return.url
Whether to return a URL
rbr
Row by Row setting, will return NAs for empty rows
envir
Which environment the data will be
The
token needed to fetch the data

Value

A dataframe of GA data.

See Also

Refer to the dimensions and metric Google help file for more details. https://developers.google.com/analytics/devguides/reporting/core/dimsmets

Other fetch data functions: getAndMergeGAAccounts; processManagementData; rollupGA; shinygaGetAccounts; shinygaGetAdWords; shinygaGetCustomDataSources; shinygaGetCustomDimensions; shinygaGetCustomMetrics; shinygaGetFilters; shinygaGetGoals; shinygaGetProfiles; shinygaGetSegments; shinygaGetUsers; shinygaGetWebProperties

Examples

Run this code
gadata <- MEgetData(123456, token=gatoken)

Run the code above in your browser using DataLab