ServiceExecute ["GoogleAnalytics" ,"request",params] sends a request to the Google Analytics API, using parameters
params. The following give possible requests.
Report Data of Website Traffic
Request:
"ReportData" — retrieve website traffic data
Parameters:
"ProfileID" (required) the Analytics view (profile) ID associated with the requested data
"StartDate" (
required)
requests need a start date; accepts DateObject and strings
"EndDate" (
required)
requests need an end date; accepts DateObject and strings
"Metrics" (required) a list of strings to specify metrics, such as "Sessions" or "Users"
"Dimensions"
None a list of strings to specify dimensions, such as "Hour" or "Day"
"Sort"
None a list of dimensions and metrics indicating the sorting order; using "-" before an element changes the sorting direction
"Filters"
None dimension or metric filters that restrict the data returned for your request
"Segment"
None segments the data returned for your request; accepts an integer Segment ID
"SamplingLevel" "Default" the desired sampling level out of "Default", "Faster", and "HigherPrecision"
"StartIndex" 1 start index
MaxItems 1000
number of elements to return
"UserIP"
None specifies IP address of the end user for whom the API call is being made
"QuotaUser"
None alternative to "UserIP" in cases when the user's IP address is unknown.
The "Filters" parameter allows the use of elements in a List to represent the AND operator between them ("Metrics" and "Dimensions" cannot be combined this way). Alternatives is used to represent the OR operator.
Metrics and Dimensions
Request:
"Metrics" — get a list of available metrics by category
"Dimensions" — get a list of available dimensions by category
Parameters:
"Category"
All filter by category
Using ServiceExecute ["GoogleAnalytics","Metrics","Categories"] shows all available categories for both "Metrics" and "Dimensions".
All Data
Request:
"AllData" — retrieve all information included in the raw output
Parameters:
"ProfileID" (required) the Analytics view (profile) ID associated with the requested data
"StartDate" (
required)
requests need a start date; accepts DateObject and strings
"EndDate" (
required)
requests need an end date; accepts DateObject and strings
"Metrics" (required) a list of strings to specify metrics, such as "Sessions" or "Users"
"Dimensions"
None a list of strings to specify dimensions, such as "Hour" or "Day"
"Sort"
None a list of dimensions and metrics indicating the sorting order; using "-" before an element changes the sorting direction
"Filters"
None dimension or metric filters that restrict the data returned for your request
"Fields"
None reduce the fields included in the output
"Segment"
None segments the data returned for your request; accepts an integer Segment ID
"SamplingLevel" "Default" the desired sampling level out of "Default", "Faster", and "HigherPrecision"
"StartIndex" 1 start index
MaxItems 1000
number of elements to return
"UserIP"
None specifies IP address of the end user for whom the API call is being made
"QuotaUser"
None alternative to "UserIP" in cases when the user's IP address is unknown.