Batch Get

Returns the Analytics data

37 variables
19 variables

Returns the Analytics data

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 37 input parameters

  = Parameter name
  = Format

useResourceQuotas BOOLEAN

Enables resource based quotas, (defaults to False). If this field is set to True the per view (profile) quotas are governed by the computational cost of the request. Note that using cost based quotas will higher enable sampling rates. (10 Million for SMALL, 100M for LARGE. See the limits and quotas documentation for details

reportRequests[] OBJECT

The main request class which specifies the Reporting API request

reportRequests[].samplingLevel ENUMERATION

The desired report sample size. If the the samplingLevel field is unspecified the DEFAULT sampling level is used. Every ReportRequest within a batchGet method must contain the same samplingLevel definition. See developer guide for details

reportRequests[].dimensions[] OBJECT

Dimensions are attributes of your data. For example, the dimension ga:city indicates the city, for example, "Paris" or "New York", from which a session originates

reportRequests[].dimensions[].histogramBuckets[] INTEGER

reportRequests[].dimensions[].name STRING

Name of the dimension to fetch, for example ga:browser

reportRequests[].dateRanges[] OBJECT

A contiguous set of days: startDate, startDate + 1 day, ..., endDate. The start and end dates are specified in ISO8601 date format YYYY-MM-DD

reportRequests[].dateRanges[].endDate STRING

The end date for the query in the format YYYY-MM-DD

reportRequests[].dateRanges[].startDate STRING

The start date for the query in the format YYYY-MM-DD

reportRequests[].pageToken STRING

A continuation token to get the next page of the results. Adding this to the request will return the rows after the pageToken. The pageToken should be the value returned in the nextPageToken parameter in the response to the GetReports request

reportRequests[].pivots[] OBJECT

The Pivot describes the pivot section in the request. The Pivot helps rearrange the information in the table for certain reports by pivoting your data on a second dimension

reportRequests[].pivots[].maxGroupCount INTEGER

Specifies the maximum number of groups to return. The default value is 10, also the maximum value is 1,000

reportRequests[].pivots[].startGroup INTEGER

If k metrics were requested, then the response will contain some data-dependent multiple of k columns in the report. E.g., if you pivoted on the dimension ga:browser then you'd get k columns for "Firefox", k columns for "IE", k columns for "Chrome", etc. The ordering of the groups of columns is determined by descending order of "total" for the first of the k values. Ties are broken by lexicographic ordering of the first pivot dimension, then lexicographic ordering of the second pivot dimension, and so on. E.g., if the totals for the first value for Firefox, IE, and Chrome were 8, 2, 8, respectively, the order of columns would be Chrome, Firefox, IE.

The following let you choose which of the groups of k columns are included in the response

reportRequests[].includeEmptyRows BOOLEAN

If set to false, the response does not include rows if all the retrieved metrics are equal to zero. The default is false which will exclude these rows

reportRequests[].metricFilterClauses[] OBJECT

Represents a group of metric filters. Set the operator value to specify how the filters are logically combined

reportRequests[].metricFilterClauses[].operator ENUMERATION

The operator for combining multiple metric filters. If unspecified, it is treated as an OR

reportRequests[].pageSize INTEGER

Page size is for paging and specifies the maximum number of returned rows. Page size should be >= 0. A query returns the default of 1,000 rows. The Analytics Core Reporting API returns a maximum of 100,000 rows per request, no matter how many you ask for. It can also return fewer rows than requested, if there aren't as many dimension segments as you expect. For instance, there are fewer than 300 possible values for ga:country, so when segmenting only by country, you can't get more than 300 rows, even if you set pageSize to a higher value

reportRequests[].hideTotals BOOLEAN

If set to true, hides the total of all metrics for all the matching rows, for every date range. The default false and will return the totals

reportRequests[].hideValueRanges BOOLEAN

If set to true, hides the minimum and maximum across all matching rows. The default is false and the value ranges are returned

reportRequests[].cohortGroup OBJECT

Defines a cohort group. For example:

"cohortGroup": {
  "cohorts": [{
    "name": "cohort 1",
    "type": "FIRST_VISIT_DATE",
    "dateRange": { "startDate": "2015-08-01", "endDate": "2015-08-01" }
  },{
    "name": "cohort 2"
     "type": "FIRST_VISIT_DATE"
     "dateRange": { "startDate": "2015-07-01", "endDate": "2015-07-01" }
  }]
}

reportRequests[].cohortGroup.cohorts[] OBJECT

Defines a cohort. A cohort is a group of users who share a common characteristic. For example, all users with the same acquisition date belong to the same cohort

reportRequests[].cohortGroup.lifetimeValue BOOLEAN

Enable Life Time Value (LTV). LTV measures lifetime value for users acquired through different channels. Please see: Cohort Analysis and Lifetime Value If the value of lifetimeValue is false:

  • The metric values are similar to the values in the web interface cohort report.
  • The cohort definition date ranges must be aligned to the calendar week and month. i.e. while requesting ga:cohortNthWeek the startDate in the cohort definition should be a Sunday and the endDate should be the following Saturday, and for ga:cohortNthMonth, the startDate should be the 1st of the month and endDate should be the last day of the month.

When the lifetimeValue is true:

  • The metric values will correspond to the values in the web interface LifeTime value report.
  • The Lifetime Value report shows you how user value (Revenue) and engagement (Appviews, Goal Completions, Sessions, and Session Duration) grow during the 90 days after a user is acquired.
  • The metrics are calculated as a cumulative average per user per the time increment.
  • The cohort definition date ranges need not be aligned to the calendar week and month boundaries.
  • The viewId must be an app view ID

reportRequests[].filtersExpression STRING

Dimension or metric filters that restrict the data returned for your request. To use the filtersExpression, supply a dimension or metric on which to filter, followed by the filter expression. For example, the following expression selects ga:browser dimension which starts with Firefox; ga:browser=~^Firefox. For more information on dimensions and metric filters, see Filters reference

reportRequests[].viewId STRING

The Analytics view ID from which to retrieve data. Every ReportRequest within a batchGet method must contain the same viewId

reportRequests[].metrics[] OBJECT

Metrics are the quantitative measurements. For example, the metric ga:users indicates the total number of users for the requested time period

reportRequests[].metrics[].expression STRING

A metric expression in the request. An expression is constructed from one or more metrics and numbers. Accepted operators include: Plus (+), Minus (-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis, Positive cardinal numbers (0-9), can include decimals and is limited to 1024 characters. Example ga:totalRefunds/ga:users, in most cases the metric expression is just a single metric name like ga:users. Adding mixed MetricType (E.g., CURRENCY + PERCENTAGE) metrics will result in unexpected results

reportRequests[].metrics[].formattingType ENUMERATION

Specifies how the metric expression should be formatted, for example INTEGER

reportRequests[].metrics[].alias STRING

An alias for the metric expression is an alternate name for the expression. The alias can be used for filtering and sorting. This field is optional and is useful if the expression is not a single metric but a complex expression which cannot be used in filtering and sorting. The alias is also used in the response column header

reportRequests[].dimensionFilterClauses[] OBJECT

A group of dimension filters. Set the operator value to specify how the filters are logically combined

reportRequests[].dimensionFilterClauses[].operator ENUMERATION

The operator for combining multiple dimension filters. If unspecified, it is treated as an OR

reportRequests[].orderBys[] OBJECT

Specifies the sorting options

reportRequests[].orderBys[].sortOrder ENUMERATION

The sorting order for the field

reportRequests[].orderBys[].fieldName STRING

The field which to sort by. The default sort order is ascending. Example: ga:browser. Note, that you can only specify one field for sort here. For example, ga:browser, ga:city is not valid

reportRequests[].orderBys[].orderType ENUMERATION

The order type. The default orderType is VALUE

reportRequests[].segments[] OBJECT

The segment definition, if the report needs to be segmented. A Segment is a subset of the Analytics data. For example, of the entire set of users, one Segment might be users from a particular country or city

reportRequests[].segments[].dynamicSegment OBJECT

Dynamic segment definition for defining the segment within the request. A segment can select users, sessions or both

reportRequests[].segments[].segmentId STRING

The segment ID of a built-in or custom segment, for example gaid::-3

Output

This building block provides 19 output parameters

  = Parameter name
  = Format

reports[] OBJECT

The data response corresponding to the request

reports[].columnHeader OBJECT

Column headers

reports[].columnHeader.dimensions[] STRING

reports[].columnHeader.metricHeader OBJECT

The headers for the metrics

reports[].data OBJECT

The data part of the report

reports[].data.dataLastRefreshed ANY

The last time the data in the report was refreshed. All the hits received before this timestamp are included in the calculation of the report

reports[].data.maximums[] OBJECT

Used to return a list of metrics for a single DateRange / dimension combination

reports[].data.minimums[] OBJECT

Used to return a list of metrics for a single DateRange / dimension combination

reports[].data.samplingSpaceSizes[] INTEGER

reports[].data.totals[] OBJECT

Used to return a list of metrics for a single DateRange / dimension combination

reports[].data.samplesReadCounts[] INTEGER

reports[].data.isDataGolden BOOLEAN

Indicates if response to this request is golden or not. Data is golden when the exact same request will not produce any new results if asked at a later point in time

reports[].data.rows[] OBJECT

A row in the report

reports[].data.rowCount INTEGER

Total number of matching rows for this query

reports[].nextPageToken STRING

Page token to retrieve the next page of results in the list

queryCost INTEGER

The amount of resource quota tokens deducted to execute the query. Includes all responses

resourceQuotasRemaining OBJECT

The resource quota tokens remaining for the property after the request is completed

resourceQuotasRemaining.hourlyQuotaTokensRemaining INTEGER

Hourly resource quota tokens remaining

resourceQuotasRemaining.dailyQuotaTokensRemaining INTEGER

Daily resource quota remaining remaining