---
title: "POST /v1beta/{+property}:runPivotReport"
method: POST
path: "/v1beta/{+property}:runPivotReport"
tags: ["properties"]
---

# POST /v1beta/{+property}:runPivotReport

`POST /v1beta/{+property}:runPivotReport`

Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.

## Path parameters

- `property` string, required

## Request body

- RunPivotReportRequest — The request to generate a pivot report.
  - `metricFilter` FilterExpression — To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.
    - `filter` Filter — An expression to filter dimension or metric values.
      - `stringFilter` StringFilter — The filter for string
        - `matchType` 'MATCH_TYPE_UNSPECIFIED' | 'EXACT' | 'BEGINS_WITH' | 'ENDS_WITH' | 'CONTAINS' | 'FULL_REGEXP' | 'PARTIAL_REGEXP' — 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.
      - `inListFilter` InListFilter — The result needs to be in a list of string values.
        - `caseSensitive` boolean — If true, the string value is case sensitive.
        - `values` string[] — The list of string values. Must be non-empty.
      - `fieldName` string — The dimension name or metric name. In most methods, dimensions & metrics can be used for the first time in this field. However in a RunPivotReportRequest, this field must be additionally specified by name in the RunPivotReportRequest's dimensions or metrics.
      - `betweenFilter` BetweenFilter — To express that the result needs to be between two numbers (inclusive).
        - `fromValue` NumericValue — To represent a number.
          - `int64Value` string, int64 — Integer value
          - `doubleValue` number, double — Double value
        - `toValue` NumericValue — To represent a number.
          - `int64Value` string, int64 — Integer value
          - `doubleValue` number, double — Double value
      - `emptyFilter` EmptyFilter — Filter for empty values.
      - `numericFilter` NumericFilter — Filters for numeric or date values.
        - `operation` 'OPERATION_UNSPECIFIED' | 'EQUAL' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' — The operation type for this filter.
        - `value` NumericValue — To represent a number.
          - `int64Value` string, int64 — Integer value
          - `doubleValue` number, double — Double value
    - `andGroup` FilterExpressionList — A list of filter expressions.
      - `expressions` FilterExpression[] — A list of filter expressions.
    - `notExpression` FilterExpression — recursive
    - `orGroup` FilterExpressionList — A list of filter expressions.
      - `expressions` FilterExpression[] — A list of filter expressions.
  - `dimensions` Dimension[] — The dimensions requested. All defined dimensions must be used by one of the following: dimension_expression, dimension_filter, pivots, order_bys.
    - `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` DimensionExpression — Used to express a dimension which is the result of a formula of multiple dimensions. Example usages: 1) lower_case(dimension) 2) concatenate(dimension1, symbol, dimension2).
      - `concatenate` ConcatenateExpression — Used to combine dimension values to a single dimension.
        - `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".
        - `dimensionNames` string[] — Names of dimensions. The names must refer back to names in the dimensions field of the request.
      - `lowerCase` CaseExpression — Used to convert a dimension value to a single case.
        - `dimensionName` string — Name of a dimension. The name must refer back to a name in dimensions field of the request.
      - `upperCase` CaseExpression — Used to convert a dimension value to a single case.
        - `dimensionName` string — Name of a dimension. The name must refer back to a name in dimensions field of the request.
  - `pivots` Pivot[] — Describes the visual format of the report's dimensions in columns or rows. The union of the fieldNames (dimension names) in all pivots must be a subset of dimension names defined in Dimensions. No two pivots can share a dimension. A dimension is only visible if it appears in a pivot.
    - `offset` string, int64 — The row count of the start row. The first row is counted as row 0.
    - `limit` string, int64 — The number of unique combinations of dimension values to return in this pivot. The `limit` parameter is required. A `limit` of 10,000 is common for single pivot requests. The product of the `limit` for each `pivot` in a `RunPivotReportRequest` must not exceed 250,000. For example, a two pivot request with `limit: 1000` in each pivot will fail because the product is `1,000,000`.
    - `metricAggregations` string[] — Aggregate the metrics by dimensions in this pivot using the specified metric_aggregations.
    - `orderBys` OrderBy[] — Specifies how dimensions are ordered in the pivot. In the first Pivot, the OrderBys determine Row and PivotDimensionHeader ordering; in subsequent Pivots, the OrderBys determine only PivotDimensionHeader ordering. Dimensions specified in these OrderBys must be a subset of Pivot.field_names.
      - `metric` MetricOrderBy — Sorts by metric values.
        - `metricName` string — A metric name in the request to order by.
      - `dimension` DimensionOrderBy — Sorts by dimension values.
        - `dimensionName` string — A dimension name in the request to order by.
        - `orderType` 'ORDER_TYPE_UNSPECIFIED' | 'ALPHANUMERIC' | 'CASE_INSENSITIVE_ALPHANUMERIC' | 'NUMERIC' — Controls the rule for dimension value ordering.
      - `pivot` PivotOrderBy — Sorts by a pivot column group.
        - `pivotSelections` PivotSelection[] — Used to select a dimension name and value pivot. If multiple pivot selections are given, the sort occurs on rows where all pivot selection dimension name and value pairs match the row's dimension name and value pair.
          - `dimensionName` string — Must be a dimension name from the request.
          - `dimensionValue` string — Order by only when the named dimension is this value.
        - `metricName` string — In the response to order by, order rows by this column. Must be a metric name from the request.
      - `desc` boolean — If true, sorts by descending order.
    - `fieldNames` string[] — Dimension names for visible columns in the report response. Including "dateRange" produces a date range column; for each row in the response, dimension values in the date range column will indicate the corresponding date range from the request.
  - `dimensionFilter` FilterExpression — To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.
    - `filter` Filter — An expression to filter dimension or metric values.
      - `stringFilter` StringFilter — The filter for string
        - `matchType` 'MATCH_TYPE_UNSPECIFIED' | 'EXACT' | 'BEGINS_WITH' | 'ENDS_WITH' | 'CONTAINS' | 'FULL_REGEXP' | 'PARTIAL_REGEXP' — 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.
      - `inListFilter` InListFilter — The result needs to be in a list of string values.
        - `caseSensitive` boolean — If true, the string value is case sensitive.
        - `values` string[] — The list of string values. Must be non-empty.
      - `fieldName` string — The dimension name or metric name. In most methods, dimensions & metrics can be used for the first time in this field. However in a RunPivotReportRequest, this field must be additionally specified by name in the RunPivotReportRequest's dimensions or metrics.
      - `betweenFilter` BetweenFilter — To express that the result needs to be between two numbers (inclusive).
        - `fromValue` NumericValue — To represent a number.
          - `int64Value` string, int64 — Integer value
          - `doubleValue` number, double — Double value
        - `toValue` NumericValue — To represent a number.
          - `int64Value` string, int64 — Integer value
          - `doubleValue` number, double — Double value
      - `emptyFilter` EmptyFilter — Filter for empty values.
      - `numericFilter` NumericFilter — Filters for numeric or date values.
        - `operation` 'OPERATION_UNSPECIFIED' | 'EQUAL' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' — The operation type for this filter.
        - `value` NumericValue — To represent a number.
          - `int64Value` string, int64 — Integer value
          - `doubleValue` number, double — Double value
    - `andGroup` FilterExpressionList — A list of filter expressions.
      - `expressions` FilterExpression[] — A list of filter expressions.
    - `notExpression` FilterExpression — recursive
    - `orGroup` FilterExpressionList — A list of filter expressions.
      - `expressions` FilterExpression[] — A list of filter expressions.
  - `returnPropertyQuota` boolean — Toggles whether to return the current state of this Google Analytics property's quota. Quota is returned in [PropertyQuota](#PropertyQuota).
  - `property` string — A Google Analytics property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). Within a batch request, this property should either be unspecified or consistent with the batch-level property. Example: properties/1234
  - `currencyCode` string — A currency code in ISO4217 format, such as "AED", "USD", "JPY". If the field is empty, the report uses the property's default currency.
  - `dateRanges` DateRange[] — The date range to retrieve event data for the report. If multiple date ranges are specified, event data from each date range is used in the report. A special dimension with field name "dateRange" can be included in a Pivot's field names; if included, the report compares between date ranges. In a cohort request, this `dateRanges` must be unspecified.
    - `endDate` string — The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot be before `start_date`. 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.
    - `startDate` string — The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot be after `end_date`. 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.
  - `comparisons` Comparison[] — Optional. The configuration of comparisons requested and displayed. The request requires both a comparisons field and a comparisons dimension to receive a comparison column in the response.
    - `comparison` string — A saved comparison identified by the comparison's resource name. For example, 'comparisons/1234'.
    - `name` string — Each comparison produces separate rows in the response. In the response, this comparison is identified by this name. If name is unspecified, we will use the saved comparisons display name.
    - `dimensionFilter` FilterExpression — To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.
      - `filter` Filter — An expression to filter dimension or metric values.
        - `stringFilter` StringFilter — The filter for string
          - `matchType` 'MATCH_TYPE_UNSPECIFIED' | 'EXACT' | 'BEGINS_WITH' | 'ENDS_WITH' | 'CONTAINS' | 'FULL_REGEXP' | 'PARTIAL_REGEXP' — 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.
        - `inListFilter` InListFilter — The result needs to be in a list of string values.
          - `caseSensitive` boolean — If true, the string value is case sensitive.
          - `values` string[] — The list of string values. Must be non-empty.
        - `fieldName` string — The dimension name or metric name. In most methods, dimensions & metrics can be used for the first time in this field. However in a RunPivotReportRequest, this field must be additionally specified by name in the RunPivotReportRequest's dimensions or metrics.
        - `betweenFilter` BetweenFilter — To express that the result needs to be between two numbers (inclusive).
          - `fromValue` NumericValue — To represent a number.
            - `int64Value` string, int64 — Integer value
            - `doubleValue` number, double — Double value
          - `toValue` NumericValue — To represent a number.
            - `int64Value` string, int64 — Integer value
            - `doubleValue` number, double — Double value
        - `emptyFilter` EmptyFilter — Filter for empty values.
        - `numericFilter` NumericFilter — Filters for numeric or date values.
          - `operation` 'OPERATION_UNSPECIFIED' | 'EQUAL' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' — The operation type for this filter.
          - `value` NumericValue — To represent a number.
            - `int64Value` string, int64 — Integer value
            - `doubleValue` number, double — Double value
      - `andGroup` FilterExpressionList — A list of filter expressions.
        - `expressions` FilterExpression[] — A list of filter expressions.
      - `notExpression` FilterExpression — recursive
      - `orGroup` FilterExpressionList — A list of filter expressions.
        - `expressions` FilterExpression[] — A list of filter expressions.
  - `metrics` Metric[] — The metrics requested, at least one metric needs to be specified. All defined metrics must be used by one of the following: metric_expression, metric_filter, order_bys.
    - `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`.
  - `cohortSpec` 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.
    - `cohortsRange` CohortsRange — Configures the extended reporting date range for a cohort report. Specifies an offset duration to follow the cohorts over.
      - `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` 'GRANULARITY_UNSPECIFIED' | 'DAILY' | 'WEEKLY' | 'MONTHLY' — 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.
    - `cohortReportSettings` CohortReportSettings — Optional settings of a cohort report.
      - `accumulate` boolean — If true, accumulates the result from first touch day to the end day. Not supported in `RunReportRequest`.
    - `cohorts` 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.
      - `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` DateRange — A contiguous set of days: `startDate`, `startDate + 1`, ..., `endDate`. Requests are allowed up to 4 date ranges.
        - `endDate` string — The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot be before `start_date`. 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.
        - `startDate` string — The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot be after `end_date`. 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.
  - `keepEmptyRows` boolean — 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 `keep_empty_rows` 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 eventName: "purchase" and eventCount: 0.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/analyticsdata.md) · [All operations](https://skmtc.dev/google/apis/analyticsdata/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/analyticsdata/revisions/b348cd401840/schema)
