- [Resource: ReportTask](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ReportTask)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ReportTask.SCHEMA_REPRESENTATION)
- [ReportDefinition](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ReportDefinition)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ReportDefinition.SCHEMA_REPRESENTATION)
- [Dimension](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Dimension)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Dimension.SCHEMA_REPRESENTATION)
- [DimensionExpression](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DimensionExpression)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DimensionExpression.SCHEMA_REPRESENTATION)
- [CaseExpression](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CaseExpression)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CaseExpression.SCHEMA_REPRESENTATION)
- [ConcatenateExpression](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ConcatenateExpression)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ConcatenateExpression.SCHEMA_REPRESENTATION)
- [Metric](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Metric)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Metric.SCHEMA_REPRESENTATION)
- [DateRange](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DateRange)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DateRange.SCHEMA_REPRESENTATION)
- [FilterExpression](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpression)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpression.SCHEMA_REPRESENTATION)
- [FilterExpressionList](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpressionList)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpressionList.SCHEMA_REPRESENTATION)
- [Filter](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Filter)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Filter.SCHEMA_REPRESENTATION)
- [StringFilter](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#StringFilter)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#StringFilter.SCHEMA_REPRESENTATION)
- [MatchType](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#MatchType)
- [InListFilter](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#InListFilter)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#InListFilter.SCHEMA_REPRESENTATION)
- [NumericFilter](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#NumericFilter)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#NumericFilter.SCHEMA_REPRESENTATION)
- [Operation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Operation)
- [NumericValue](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#NumericValue)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#NumericValue.SCHEMA_REPRESENTATION)
- [BetweenFilter](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#BetweenFilter)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#BetweenFilter.SCHEMA_REPRESENTATION)
- [EmptyFilter](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#EmptyFilter)
- [MetricAggregation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#MetricAggregation)
- [OrderBy](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#OrderBy)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#OrderBy.SCHEMA_REPRESENTATION)
- [MetricOrderBy](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#MetricOrderBy)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#MetricOrderBy.SCHEMA_REPRESENTATION)
- [DimensionOrderBy](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DimensionOrderBy)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DimensionOrderBy.SCHEMA_REPRESENTATION)
- [OrderType](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#OrderType)
- [CohortSpec](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CohortSpec)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CohortSpec.SCHEMA_REPRESENTATION)
- [Cohort](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Cohort)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Cohort.SCHEMA_REPRESENTATION)
- [CohortsRange](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CohortsRange)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CohortsRange.SCHEMA_REPRESENTATION)
- [Granularity](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Granularity)
- [CohortReportSettings](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CohortReportSettings)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CohortReportSettings.SCHEMA_REPRESENTATION)
- [SamplingLevel](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#SamplingLevel)
- [ReportMetadata](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ReportMetadata)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ReportMetadata.SCHEMA_REPRESENTATION)
- [State](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#State)
- [Methods](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#METHODS_SUMMARY)

## Resource: ReportTask

A specific report task configuration.

| JSON representation |
|---|
| ``` { "name": string, "reportDefinition": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ReportDefinition`) }, "reportMetadata": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ReportMetadata`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Identifier. The report task resource name assigned during creation. Format: "properties/{property}/reportTasks/{reportTask}" |
| `reportDefinition` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ReportDefinition`)`` Optional. A report definition to fetch report data, which describes the structure of a report. It typically includes the fields that will be included in the report and the criteria that will be used to filter the data. |
| `reportMetadata` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ReportMetadata`)`` Output only. The report metadata for a specific report task, which provides information about a report. It typically includes the following information: the resource name of the report, the state of the report, the timestamp the report was created, etc, |

## ReportDefinition

The definition of how a report should be run.

| JSON representation |
|---|
| ``` { "dimensions": [ { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Dimension`) } ], "metrics": [ { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Metric`) } ], "dateRanges": [ { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DateRange`) } ], "dimensionFilter": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpression`) }, "metricFilter": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpression`) }, "offset": string, "limit": string, "metricAggregations": [ enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#MetricAggregation`) ], "orderBys": [ { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#OrderBy`) } ], "currencyCode": string, "cohortSpec": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CohortSpec`) }, "keepEmptyRows": boolean, "samplingLevel": enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#SamplingLevel`) } ``` |

| Fields ||
|---|---|
| `dimensions[]` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Dimension`)`` Optional. The dimensions requested and displayed. |
| `metrics[]` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Metric`)`` Optional. The metrics requested and displayed. |
| `dateRanges[]` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DateRange`)`` Optional. Date ranges of data to read. If multiple date ranges are requested, each response row will contain a zero based date range index. If two date ranges overlap, the event data for the overlapping days is included in the response rows for both date ranges. In a cohort request, this `dateRanges` must be unspecified. |
| `dimensionFilter` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpression`)`` Optional. Dimension filters let you ask for only specific dimension values in the report. To learn more, see [Fundamentals of Dimension Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) for examples. Metrics cannot be used in this filter. |
| `metricFilter` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpression`)`` Optional. The filter clause of metrics. Applied after aggregating the report's rows, similar to SQL having-clause. Dimensions cannot be used in this filter. |
| `offset` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. The row count of the start row from Google Analytics Storage. The first row is counted as row 0. When creating a report task, the `offset` and `limit` parameters define the subset of data rows from Google Analytics storage to be included in the generated report. For example, if there are a total of 300,000 rows in Google Analytics storage, the initial report task may have the first 10,000 rows with a limit of 10,000 and an offset of 0. Subsequently, another report task could cover the next 10,000 rows with a limit of 10,000 and an offset of 10,000. |
| `limit` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. The number of rows to return in the Report. If unspecified, 10,000 rows are returned. The API returns a maximum of 250,000 rows per request, no matter how many you ask for. `limit` must be positive. The API can also return fewer rows than the requested `limit`, if there aren't as many dimension values as the `limit`. For instance, there are fewer than 300 possible values for the dimension `country`, so when reporting on only `country`, you can't get more than 300 rows, even if you set `limit` to a higher value. |
| `metricAggregations[]` | ``enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#MetricAggregation`)`` Optional. Aggregation of metrics. Aggregated metric values will be shown in rows where the dimensionValues are set to "RESERVED_(MetricAggregation)". |
| `orderBys[]` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#OrderBy`)`` Optional. Specifies how rows are ordered in the response. |
| `currencyCode` | `string` Optional. A currency code in ISO4217 format, such as "AED", "USD", "JPY". If the field is empty, the report uses the property's default currency. |
| `cohortSpec` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CohortSpec`)`` Optional. Cohort group associated with this request. If there is a cohort group in the request the 'cohort' dimension must be present. |
| `keepEmptyRows` | `boolean` Optional. If false or unspecified, each row with all metrics equal to 0 will not be returned. If true, these rows will be returned if they are not separately removed by a filter. Regardless of this `keepEmptyRows` setting, only data recorded by the Google Analytics property can be displayed in a report. For example if a property never logs a `purchase` event, then a query for the `eventName` dimension and `eventCount` metric will not have a row containing eventName: "purchase" and eventCount: 0. |
| `samplingLevel` | ``enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#SamplingLevel`)`` Optional. The report's sampling level. |

## Dimension

Dimensions are attributes of your data. For example, the dimension city indicates the city from which an event originates. Dimension values in report responses are strings; for example, the city could be "Paris" or "New York".

| JSON representation |
|---|
| ``` { "name": string, "dimensionExpression": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DimensionExpression`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` The name of the dimension. See the [API Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) for the list of dimension names supported by core reporting methods such as `runReport` and `batchRunReports`. See [Realtime Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#dimensions) for the list of dimension names supported by the `runRealtimeReport` method. See [Funnel Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/exploration-api-schema#dimensions) for the list of dimension names supported by the `runFunnelReport` method. If `dimensionExpression` is specified, `name` can be any string that you would like within the allowed character set. For example if a `dimensionExpression` concatenates `country` and `city`, you could call that dimension `countryAndCity`. Dimension names that you choose must match the regular expression `^[a-zA-Z0-9_]$`. Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, `dimensionExpression`, and `pivots`. |
| `dimensionExpression` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DimensionExpression`)`` One dimension can be the result of an expression of multiple dimensions. For example, dimension "country, city": concatenate(country, ", ", city). |

## DimensionExpression

Used to express a dimension which is the result of a formula of multiple dimensions. Example usages: 1) lowerCase(dimension) 2) concatenate(dimension1, symbol, dimension2).

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "lowerCase": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CaseExpression`) }, "upperCase": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CaseExpression`) }, "concatenate": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ConcatenateExpression`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| Specify one type of dimension expression for `DimensionExpression`. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `lowerCase` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CaseExpression`)`` Used to convert a dimension value to lower case. |
| `upperCase` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CaseExpression`)`` Used to convert a dimension value to upper case. |
| `concatenate` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#ConcatenateExpression`)`` Used to combine dimension values to a single dimension. For example, dimension "country, city": concatenate(country, ", ", city). |
| End of mutually exclusive fields. ||

## CaseExpression

Used to convert a dimension value to a single case.

| JSON representation |
|---|
| ``` { "dimensionName": string } ``` |

| Fields ||
|---|---|
| `dimensionName` | `string` Name of a dimension. The name must refer back to a name in dimensions field of the request. |

## ConcatenateExpression

Used to combine dimension values to a single dimension.

| JSON representation |
|---|
| ``` { "dimensionNames": [ string ], "delimiter": string } ``` |

| Fields ||
|---|---|
| `dimensionNames[]` | `string` Names of dimensions. The names must refer back to names in the dimensions field of the request. |
| `delimiter` | `string` The delimiter placed between dimension names. Delimiters are often single characters such as "\|" or "," but can be longer strings. If a dimension value contains the delimiter, both will be present in response with no distinction. For example if dimension 1 value = "US,FR", dimension 2 value = "JP", and delimiter = ",", then the response will contain "US,FR,JP". |

## Metric

The quantitative measurements of a report. For example, the metric `eventCount` is the total number of events. Requests are allowed up to 10 metrics.

| JSON representation |
|---|
| ``` { "name": string, "expression": string, "invisible": boolean } ``` |

| Fields ||
|---|---|
| `name` | `string` The name of the metric. See the [API Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) for the list of metric names supported by core reporting methods such as `runReport` and `batchRunReports`. See [Realtime Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#metrics) for the list of metric names supported by the `runRealtimeReport` method. See [Funnel Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/exploration-api-schema#metrics) for the list of metric names supported by the `runFunnelReport` method. If `expression` is specified, `name` can be any string that you would like within the allowed character set. For example if `expression` is `screenPageViews/sessions`, you could call that metric's name = `viewsPerSession`. Metric names that you choose must match the regular expression `^[a-zA-Z0-9_]$`. Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric `expression`. |
| `expression` | `string` A mathematical expression for derived metrics. For example, the metric Event count per user is `eventCount/totalUsers`. |
| `invisible` | `boolean` Indicates if a metric is invisible in the report response. If a metric is invisible, the metric will not produce a column in the response, but can be used in `metricFilter`, `orderBys`, or a metric `expression`. |

## DateRange

A contiguous set of days: `startDate`, `startDate + 1`, ..., `endDate`. Requests are allowed up to 4 date ranges.

| JSON representation |
|---|
| ``` { "startDate": string, "endDate": string, "name": string } ``` |

| Fields ||
|---|---|
| `startDate` | `string` The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot be after `endDate`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property's reporting time zone. |
| `endDate` | `string` The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot be before `startDate`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property's reporting time zone. |
| `name` | `string` Assigns a name to this date range. The dimension `dateRange` is valued to this name in a report response. If set, cannot begin with `date_range_` or `RESERVED_`. If not set, date ranges are named by their zero based index in the request: `date_range_0`, `date_range_1`, etc. |

## FilterExpression

To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "andGroup": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpressionList`) }, "orGroup": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpressionList`) }, "notExpression": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpression`) }, "filter": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Filter`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| Specify one type of filter expression for `FilterExpression`. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `andGroup` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpressionList`)`` The FilterExpressions in andGroup have an AND relationship. |
| `orGroup` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpressionList`)`` The FilterExpressions in orGroup have an OR relationship. |
| `notExpression` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpression`)`` The FilterExpression is NOT of notExpression. |
| `filter` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Filter`)`` A primitive filter. In the same FilterExpression, all of the filter's field names need to be either all dimensions or all metrics. |
| End of mutually exclusive fields. ||

## FilterExpressionList

A list of filter expressions.

| JSON representation |
|---|
| ``` { "expressions": [ { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpression`) } ] } ``` |

| Fields ||
|---|---|
| `expressions[]` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#FilterExpression`)`` A list of filter expressions. |

## Filter

An expression to filter dimension or metric values.

| JSON representation |
|---|
| ``` { "fieldName": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "stringFilter": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#StringFilter`) }, "inListFilter": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#InListFilter`) }, "numericFilter": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#NumericFilter`) }, "betweenFilter": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#BetweenFilter`) }, "emptyFilter": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#EmptyFilter`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `fieldName` | `string` The dimension name or metric name. Must be a name defined in dimensions or metrics. |
| Specify one type of filter for `Filter`. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `stringFilter` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#StringFilter`)`` Strings related filter. |
| `inListFilter` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#InListFilter`)`` A filter for in list values. |
| `numericFilter` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#NumericFilter`)`` A filter for numeric or date values. |
| `betweenFilter` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#BetweenFilter`)`` A filter for between two values. |
| `emptyFilter` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#EmptyFilter`)`` A filter for empty values such as `(not set)` and `""` values. |
| End of mutually exclusive fields. ||

## StringFilter

The filter for string

| JSON representation |
|---|
| ``` { "matchType": enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#MatchType`), "value": string, "caseSensitive": boolean } ``` |

| Fields ||
|---|---|
| `matchType` | ``enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#MatchType`)`` The match type for this filter. |
| `value` | `string` The string value used for the matching. |
| `caseSensitive` | `boolean` If true, the string value is case sensitive. |

## MatchType

The match type of a string filter

| Enums ||
|---|---|
| `MATCH_TYPE_UNSPECIFIED` | Unspecified |
| `EXACT` | Exact match of the string value. |
| `BEGINS_WITH` | Begins with the string value. |
| `ENDS_WITH` | Ends with the string value. |
| `CONTAINS` | Contains the string value. |
| `FULL_REGEXP` | Full match for the regular expression with the string value. |
| `PARTIAL_REGEXP` | Partial match for the regular expression with the string value. |

## InListFilter

The result needs to be in a list of string values.

| JSON representation |
|---|
| ``` { "values": [ string ], "caseSensitive": boolean } ``` |

| Fields ||
|---|---|
| `values[]` | `string` The list of string values. Must be non-empty. |
| `caseSensitive` | `boolean` If true, the string value is case sensitive. |

## NumericFilter

Filters for numeric or date values.

| JSON representation |
|---|
| ``` { "operation": enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Operation`), "value": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#NumericValue`) } } ``` |

| Fields ||
|---|---|
| `operation` | ``enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Operation`)`` The operation type for this filter. |
| `value` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#NumericValue`)`` A numeric value or a date value. |

## Operation

The operation applied to a numeric filter

| Enums ||
|---|---|
| `OPERATION_UNSPECIFIED` | Unspecified. |
| `EQUAL` | Equal |
| `LESS_THAN` | Less than |
| `LESS_THAN_OR_EQUAL` | Less than or equal |
| `GREATER_THAN` | Greater than |
| `GREATER_THAN_OR_EQUAL` | Greater than or equal |

## NumericValue

To represent a number.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "int64Value": string, "doubleValue": number // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| One of a numeric value The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `int64Value` | `string (https://developers.google.com/discovery/v1/type-format format)` Integer value |
| `doubleValue` | `number` Double value |
| End of mutually exclusive fields. ||

## BetweenFilter

To express that the result needs to be between two numbers (inclusive).

| JSON representation |
|---|
| ``` { "fromValue": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#NumericValue`) }, "toValue": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#NumericValue`) } } ``` |

| Fields ||
|---|---|
| `fromValue` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#NumericValue`)`` Begins with this number. |
| `toValue` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#NumericValue`)`` Ends with this number. |

## EmptyFilter

This type has no fields.
Filter for empty values. Matches dimension values that are `""` or `(not set)` values. Use this filter to match rows with missing or unpopulated dimension values, or combine it with `notExpression` to exclude them from a report without filtering for both `""` and `(not set)` separately.

## MetricAggregation

Represents aggregation of metrics.

| Enums ||
|---|---|
| `METRIC_AGGREGATION_UNSPECIFIED` | Unspecified operator. |
| `TOTAL` | SUM operator. |
| `MINIMUM` | Minimum operator. |
| `MAXIMUM` | Maximum operator. |
| `COUNT` | Count operator. |

## OrderBy

Order bys define how rows will be sorted in the response. For example, ordering rows by descending event count is one ordering, and ordering rows by the event name string is a different ordering.

| JSON representation |
|---|
| ``` { "desc": boolean, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "metric": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#MetricOrderBy`) }, "dimension": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DimensionOrderBy`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `desc` | `boolean` If true, sorts by descending order. |
| Specify one type of order by for `OrderBy`. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `metric` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#MetricOrderBy`)`` Sorts results by a metric's values. |
| `dimension` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DimensionOrderBy`)`` Sorts results by a dimension's values. |
| End of mutually exclusive fields. ||

## MetricOrderBy

Sorts by metric values.

| JSON representation |
|---|
| ``` { "metricName": string } ``` |

| Fields ||
|---|---|
| `metricName` | `string` A metric name in the request to order by. |

## DimensionOrderBy

Sorts by dimension values.

| JSON representation |
|---|
| ``` { "dimensionName": string, "orderType": enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#OrderType`) } ``` |

| Fields ||
|---|---|
| `dimensionName` | `string` A dimension name in the request to order by. |
| `orderType` | ``enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#OrderType`)`` Controls the rule for dimension value ordering. |

## OrderType

Rule to order the string dimension values by.

| Enums ||
|---|---|
| `ORDER_TYPE_UNSPECIFIED` | Unspecified. |
| `ALPHANUMERIC` | Alphanumeric sort by Unicode code point. For example, "2" \< "A" \< "X" \< "b" \< "z". |
| `CASE_INSENSITIVE_ALPHANUMERIC` | Case insensitive alphanumeric sort by lower case Unicode code point. For example, "2" \< "A" \< "b" \< "X" \< "z". |
| `NUMERIC` | Dimension values are converted to numbers before sorting. For example in NUMERIC sort, "25" \< "100", and in `ALPHANUMERIC` sort, "100" \< "25". Non-numeric dimension values all have equal ordering value below all numeric values. |

## CohortSpec

The specification of cohorts for a cohort report.

Cohort reports create a time series of user retention for the cohort. For example, you could select the cohort of users that were acquired in the first week of September and follow that cohort for the next six weeks. Selecting the users acquired in the first week of September cohort is specified in the `cohort` object. Following that cohort for the next six weeks is specified in the `cohortsRange` object.

For examples, see [Cohort Report Examples](https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples).

The report response could show a weekly time series where say your app has retained 60% of this cohort after three weeks and 25% of this cohort after six weeks. These two percentages can be calculated by the metric `cohortActiveUsers/cohortTotalUsers` and will be separate rows in the report.

| JSON representation |
|---|
| ``` { "cohorts": [ { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Cohort`) } ], "cohortsRange": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CohortsRange`) }, "cohortReportSettings": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CohortReportSettings`) } } ``` |

| Fields ||
|---|---|
| `cohorts[]` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Cohort`)`` Defines the selection criteria to group users into cohorts. Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name. |
| `cohortsRange` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CohortsRange`)`` Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over. |
| `cohortReportSettings` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#CohortReportSettings`)`` Optional settings for a cohort report. |

## Cohort

Defines a cohort selection criteria. A cohort is a group of users who share a common characteristic. For example, users with the same `firstSessionDate` belong to the same cohort.

| JSON representation |
|---|
| ``` { "name": string, "dimension": string, "dateRange": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DateRange`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` Assigns a name to this cohort. The dimension `cohort` is valued to this name in a report response. If set, cannot begin with `cohort_` or `RESERVED_`. If not set, cohorts are named by their zero based index `cohort_0`, `cohort_1`, etc. |
| `dimension` | `string` Dimension used by the cohort. Required and only supports `firstSessionDate`. |
| `dateRange` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#DateRange`)`` The cohort selects users whose first touch date is between start date and end date defined in the `dateRange`. This `dateRange` does not specify the full date range of event data that is present in a cohort report. In a cohort report, this `dateRange` is extended by the granularity and offset present in the `cohortsRange`; event data for the extended reporting date range is present in a cohort report. In a cohort request, this `dateRange` is required and the `dateRanges` in the `RunReportRequest` or `RunPivotReportRequest` must be unspecified. This `dateRange` should generally be aligned with the cohort's granularity. If `CohortsRange` uses daily granularity, this `dateRange` can be a single day. If `CohortsRange` uses weekly granularity, this `dateRange` can be aligned to a week boundary, starting at Sunday and ending Saturday. If `CohortsRange` uses monthly granularity, this `dateRange` can be aligned to a month, starting at the first and ending on the last day of the month. |

## CohortsRange

Configures the extended reporting date range for a cohort report. Specifies an offset duration to follow the cohorts over.

| JSON representation |
|---|
| ``` { "granularity": enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Granularity`), "startOffset": integer, "endOffset": integer } ``` |

| Fields ||
|---|---|
| `granularity` | ``enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#Granularity`)`` Required. The granularity used to interpret the `startOffset` and `endOffset` for the extended reporting date range for a cohort report. |
| `startOffset` | `integer` `startOffset` specifies the start date of the extended reporting date range for a cohort report. `startOffset` is commonly set to 0 so that reports contain data from the acquisition of the cohort forward. If `granularity` is `DAILY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset` days. If `granularity` is `WEEKLY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset * 7` days. If `granularity` is `MONTHLY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset * 30` days. |
| `endOffset` | `integer` Required. `endOffset` specifies the end date of the extended reporting date range for a cohort report. `endOffset` can be any positive integer but is commonly set to 5 to 10 so that reports contain data on the cohort for the next several granularity time periods. If `granularity` is `DAILY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset` days. If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset * 7` days. If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset * 30` days. |

## Granularity

The granularity used to interpret the `startOffset` and `endOffset` for the extended reporting date range for a cohort report.

| Enums ||
|---|---|
| `GRANULARITY_UNSPECIFIED` | Should never be specified. |
| `DAILY` | Daily granularity. Commonly used if the cohort's `dateRange` is a single day and the request contains `cohortNthDay`. |
| `WEEKLY` | Weekly granularity. Commonly used if the cohort's `dateRange` is a week in duration (starting on Sunday and ending on Saturday) and the request contains `cohortNthWeek`. |
| `MONTHLY` | Monthly granularity. Commonly used if the cohort's `dateRange` is a month in duration and the request contains `cohortNthMonth`. |

## CohortReportSettings

Optional settings of a cohort report.

| JSON representation |
|---|
| ``` { "accumulate": boolean } ``` |

| Fields ||
|---|---|
| `accumulate` | `boolean` If true, accumulates the result from first touch day to the end day. Not supported in `RunReportRequest`. |

## SamplingLevel

Categories of sampling levels for the requests.

| Enums ||
|---|---|
| `SAMPLING_LEVEL_UNSPECIFIED` | Unspecified type. |
| `LOW` | Applies a sampling level of 10 million to standard properties and 100 million to Google Analytics 360 properties. |
| `MEDIUM` | Exclusive to Google Analytics 360 properties with a sampling level of 1 billion. |
| `UNSAMPLED` | Exclusive to Google Analytics 360 properties. Unsampled explorations are more accurate and can reveal insights that aren't visible in standard explorations. To learn more, see <https://support.google.com/analytics/answer/10896953>. |

## ReportMetadata

The report metadata for a specific report task.

| JSON representation |
|---|
| ``` { "creationQuotaTokensCharged": integer, "state": enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#State`), "beginCreatingTime": string, "taskRowCount": integer, "errorMessage": string, "totalRowCount": integer } ``` |

| Fields ||
|---|---|
| `creationQuotaTokensCharged` | `integer` Output only. The total quota tokens charged during creation of the report. Because this token count is based on activity from the `CREATING` state, this tokens charge will be fixed once a report task enters the `ACTIVE` or `FAILED` state. |
| `state` | ``enum (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks#State`)`` Output only. The current state for this report task. |
| `beginCreatingTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when `reportTasks.create` was called and the report began the `CREATING` state. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `taskRowCount` | `integer` Output only. The total number of rows in the report result. This field will be populated when the state is active. You can utilize `taskRowCount` for pagination within the confines of their existing report. |
| `errorMessage` | `string` Output only. Error message is populated if a report task fails during creation. |
| `totalRowCount` | `integer` Output only. The total number of rows in Google Analytics storage. If you want to query additional data rows beyond the current report, they can initiate a new report task based on the `totalRowCount`. The `taskRowCount` represents the number of rows specifically pertaining to the current report, whereas `totalRowCount` encompasses the total count of rows across all data retrieved from Google Analytics storage. For example, suppose the current report's `taskRowCount` is 20, displaying the data from the first 20 rows. Simultaneously, the `totalRowCount` is 30, indicating the presence of data for all 30 rows. The `taskRowCount` can be utilizated to paginate through the initial 20 rows. To expand the report and include data from all 30 rows, a new report task can be created using the totalRowCount to access the full set of 30 rows' worth of data. |

## State

The processing state.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Unspecified state will never be used. |
| `CREATING` | The report is currently creating and will be available in the future. Creating occurs immediately after the CreateReport call. |
| `ACTIVE` | The report is fully created and ready for querying. |
| `FAILED` | The report failed to be created. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks/create` | Initiates the creation of a report task. |
| ### `https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks/get` | Gets report metadata about a specific report task. |
| ### `https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks/list` | Lists all report tasks for a property. |
| ### `https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks/query` | Retrieves a report task's content. |