Get
|
|||||
|
|
Returns Analytics data for a view (profile)
Authorization
To use this building block you will have to grant access to at least one of the following scopes:
- View and manage your Google Analytics data
- View your Google Analytics data
Input
This building block consumes 13 input parameters
Name | Format | Description |
---|---|---|
ids Required |
STRING |
Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID |
start-date Required |
STRING |
Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo |
end-date Required |
STRING |
End date for fetching Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is yesterday |
metrics Required |
STRING |
A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified |
dimensions |
STRING |
A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city' |
filters |
STRING |
A comma-separated list of dimension or metric filters to be applied to Analytics data |
include-empty-rows |
BOOLEAN |
The response will include empty rows if this parameter is set to true, the default is true |
max-results |
INTEGER |
The maximum number of entries to include in this feed |
output |
ENUMERATION |
The selected format for the response. Default format is JSON |
samplingLevel |
ENUMERATION |
The desired sampling level |
segment |
STRING |
An Analytics segment to be applied to data |
sort |
STRING |
A comma-separated list of dimensions or metrics that determine the sort order for Analytics data |
start-index |
INTEGER |
An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter |
= Parameter name
= Format
ids STRING Required Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID |
start-date STRING Required Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo |
end-date STRING Required End date for fetching Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is yesterday |
metrics STRING Required A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified |
dimensions STRING A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city' |
filters STRING A comma-separated list of dimension or metric filters to be applied to Analytics data |
include-empty-rows BOOLEAN The response will include empty rows if this parameter is set to true, the default is true |
max-results INTEGER The maximum number of entries to include in this feed |
output ENUMERATION The selected format for the response. Default format is JSON |
samplingLevel ENUMERATION The desired sampling level |
segment STRING An Analytics segment to be applied to data |
sort STRING A comma-separated list of dimensions or metrics that determine the sort order for Analytics data |
start-index INTEGER An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter |
Output
This building block provides 45 output parameters
Name | Format | Description |
---|---|---|
columnHeaders[] |
OBJECT |
|
columnHeaders[].columnType |
STRING |
Column Type. Either DIMENSION or METRIC |
columnHeaders[].dataType |
STRING |
Data type. Dimension column headers have only STRING as the data type. Metric column headers have data types for metric values such as INTEGER, DOUBLE, CURRENCY etc |
columnHeaders[].name |
STRING |
Column name |
containsSampledData |
BOOLEAN |
Determines if Analytics data contains samples |
dataLastRefreshed |
INTEGER |
The last refreshed time in seconds for Analytics data |
dataTable |
OBJECT |
|
dataTable.cols[] |
OBJECT |
|
dataTable.cols[].id |
STRING |
|
dataTable.cols[].label |
STRING |
|
dataTable.cols[].type |
STRING |
|
dataTable.rows[] |
OBJECT |
|
dataTable.rows[].c[] |
OBJECT |
|
dataTable.rows[].c[].v |
STRING |
|
id |
STRING |
Unique ID for this data response |
itemsPerPage |
INTEGER |
The maximum number of rows the response can contain, regardless of the actual number of rows returned. Its value ranges from 1 to 10,000 with a value of 1000 by default, or otherwise specified by the max-results query parameter |
kind |
STRING |
Resource type |
nextLink |
STRING |
Link to next page for this Analytics data query |
previousLink |
STRING |
Link to previous page for this Analytics data query |
profileInfo |
OBJECT |
Information for the view (profile), for which the Analytics data was requested |
profileInfo.accountId |
STRING |
Account ID to which this view (profile) belongs |
profileInfo.internalWebPropertyId |
STRING |
Internal ID for the web property to which this view (profile) belongs |
profileInfo.profileId |
STRING |
View (Profile) ID |
profileInfo.profileName |
STRING |
View (Profile) name |
profileInfo.tableId |
STRING |
Table ID for view (profile) |
profileInfo.webPropertyId |
STRING |
Web Property ID to which this view (profile) belongs |
query |
OBJECT |
Analytics data request query parameters |
query.dimensions |
STRING |
List of analytics dimensions |
query.end-date |
STRING |
End date |
query.filters |
STRING |
Comma-separated list of dimension or metric filters |
query.ids |
STRING |
Unique table ID |
query.max-results |
INTEGER |
Maximum results per page |
query.metrics[] |
STRING |
|
query.samplingLevel |
STRING |
Desired sampling level |
query.segment |
STRING |
Analytics advanced segment |
query.sort[] |
STRING |
|
query.start-date |
STRING |
Start date |
query.start-index |
INTEGER |
Start index |
rows[] |
OBJECT_ARRAY |
|
sampleSize |
INTEGER |
The number of samples used to calculate the result |
sampleSpace |
INTEGER |
Total size of the sample space from which the samples were selected |
selfLink |
STRING |
Link to this page |
totalResults |
INTEGER |
The total number of rows for the query, regardless of the number of rows in the response |
totalsForAllResults |
OBJECT |
Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as the metric order specified in the request |
totalsForAllResults.customKey.value |
STRING |
Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as the metric order specified in the request |
= Parameter name
= Format
columnHeaders[] OBJECT |
columnHeaders[].columnType STRING Column Type. Either DIMENSION or METRIC |
columnHeaders[].dataType STRING Data type. Dimension column headers have only STRING as the data type. Metric column headers have data types for metric values such as INTEGER, DOUBLE, CURRENCY etc |
columnHeaders[].name STRING Column name |
containsSampledData BOOLEAN Determines if Analytics data contains samples |
dataLastRefreshed INTEGER The last refreshed time in seconds for Analytics data |
dataTable OBJECT |
dataTable.cols[] OBJECT |
dataTable.cols[].id STRING |
dataTable.cols[].label STRING |
dataTable.cols[].type STRING |
dataTable.rows[] OBJECT |
dataTable.rows[].c[] OBJECT |
dataTable.rows[].c[].v STRING |
id STRING Unique ID for this data response |
itemsPerPage INTEGER The maximum number of rows the response can contain, regardless of the actual number of rows returned. Its value ranges from 1 to 10,000 with a value of 1000 by default, or otherwise specified by the max-results query parameter |
kind STRING Resource type |
nextLink STRING Link to next page for this Analytics data query |
previousLink STRING Link to previous page for this Analytics data query |
profileInfo OBJECT Information for the view (profile), for which the Analytics data was requested |
profileInfo.accountId STRING Account ID to which this view (profile) belongs |
profileInfo.internalWebPropertyId STRING Internal ID for the web property to which this view (profile) belongs |
profileInfo.profileId STRING View (Profile) ID |
profileInfo.profileName STRING View (Profile) name |
profileInfo.tableId STRING Table ID for view (profile) |
profileInfo.webPropertyId STRING Web Property ID to which this view (profile) belongs |
query OBJECT Analytics data request query parameters |
query.dimensions STRING List of analytics dimensions |
query.end-date STRING End date |
query.filters STRING Comma-separated list of dimension or metric filters |
query.ids STRING Unique table ID |
query.max-results INTEGER Maximum results per page |
query.metrics[] STRING |
query.samplingLevel STRING Desired sampling level |
query.segment STRING Analytics advanced segment |
query.sort[] STRING |
query.start-date STRING Start date |
query.start-index INTEGER Start index |
rows[] OBJECT_ARRAY |
sampleSize INTEGER The number of samples used to calculate the result |
sampleSpace INTEGER Total size of the sample space from which the samples were selected |
selfLink STRING Link to this page |
totalResults INTEGER The total number of rows for the query, regardless of the number of rows in the response |
totalsForAllResults OBJECT Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as the metric order specified in the request |
totalsForAllResults.customKey.value STRING Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as the metric order specified in the request |