MCP Tools Reference: analyticsdata.googleapis.com

Tool: run_report

Returns a customized report of your Google Analytics event data.

The following sample demonstrate how to use curl to invoke the run_report MCP tool.

Curl Request
                  
curl --location 'https://analyticsdata.googleapis.com/mcp/v1' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "run_report",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

Input Schema

The request to generate a report.

RunReportRequest

JSON representation
{
  "property": string,
  "dimensions": [
    {
      object (Dimension)
    }
  ],
  "metrics": [
    {
      object (Metric)
    }
  ],
  "dateRanges": [
    {
      object (DateRange)
    }
  ],
  "dimensionFilter": {
    object (FilterExpression)
  },
  "metricFilter": {
    object (FilterExpression)
  },
  "offset": string,
  "limit": string,
  "metricAggregations": [
    enum (MetricAggregation)
  ],
  "orderBys": [
    {
      object (OrderBy)
    }
  ],
  "currencyCode": string,
  "cohortSpec": {
    object (CohortSpec)
  },
  "keepEmptyRows": boolean,
  "returnPropertyQuota": boolean,
  "comparisons": [
    {
      object (Comparison)
    }
  ]
}
Fields
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. Within a batch request, this property should either be unspecified or consistent with the batch-level property.

Example: properties/1234

dimensions[]

object (Dimension)

The dimensions requested and displayed.

metrics[]

object (Metric)

The metrics requested and displayed.

dateRanges[]

object (DateRange)

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 (FilterExpression)

Dimension filters let you ask for only specific dimension values in the report. To learn more, see Fundamentals of Dimension Filters for examples. Metrics cannot be used in this filter.

metricFilter

object (FilterExpression)

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 (int64 format)

The row count of the start row. The first row is counted as row 0.

When paging, the first request does not specify offset; or equivalently, sets offset to 0; the first request returns the first limit of rows. The second request sets offset to the limit of the first request; the second request returns the second limit of rows.

To learn more about this pagination parameter, see Pagination.

limit

string (int64 format)

The number of rows to return. 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.

To learn more about this pagination parameter, see Pagination.

metricAggregations[]

enum (MetricAggregation)

Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to "RESERVED_(MetricAggregation)". Aggregates including both comparisons and multiple date ranges will be aggregated based on the date ranges.

orderBys[]

object (OrderBy)

Specifies how rows are ordered in the response. Requests including both comparisons and multiple date ranges will have order bys applied on the comparisons.

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.

cohortSpec

object (CohortSpec)

Cohort group associated with this request. If there is a cohort group in the request the 'cohort' dimension must be present.

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.

returnPropertyQuota

boolean

Toggles whether to return the current state of this Google Analytics property's quota. Quota is returned in PropertyQuota.

comparisons[]

object (Comparison)

Optional. The configuration of comparisons requested and displayed. The request only requires a comparisons field in order to receive a comparison column in the response.

Dimension

JSON representation
{
  "name": string,
  "dimensionExpression": {
    object (DimensionExpression)
  }
}
Fields
name

string

The name of the dimension. See the API Dimensions for the list of dimension names supported by core reporting methods such as runReport and batchRunReports. See Realtime Dimensions for the list of dimension names supported by the runRealtimeReport method. See Funnel 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 (DimensionExpression)

One dimension can be the result of an expression of multiple dimensions. For example, dimension "country, city": concatenate(country, ", ", city).

DimensionExpression

JSON representation
{

  // Union field one_expression can be only one of the following:
  "lowerCase": {
    object (CaseExpression)
  },
  "upperCase": {
    object (CaseExpression)
  },
  "concatenate": {
    object (ConcatenateExpression)
  }
  // End of list of possible types for union field one_expression.
}
Fields
Union field one_expression. Specify one type of dimension expression for DimensionExpression. one_expression can be only one of the following:
lowerCase

object (CaseExpression)

Used to convert a dimension value to lower case.

upperCase

object (CaseExpression)

Used to convert a dimension value to upper case.

concatenate

object (ConcatenateExpression)

Used to combine dimension values to a single dimension. For example, dimension "country, city": concatenate(country, ", ", city).

CaseExpression

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

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

JSON representation
{
  "name": string,
  "expression": string,
  "invisible": boolean
}
Fields
name

string

The name of the metric. See the API Metrics for the list of metric names supported by core reporting methods such as runReport and batchRunReports. See Realtime Metrics for the list of metric names supported by the runRealtimeReport method. See Funnel 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

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 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.

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.

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

JSON representation
{

  // Union field expr can be only one of the following:
  "andGroup": {
    object (FilterExpressionList)
  },
  "orGroup": {
    object (FilterExpressionList)
  },
  "notExpression": {
    object (FilterExpression)
  },
  "filter": {
    object (Filter)
  }
  // End of list of possible types for union field expr.
}
Fields
Union field expr. Specify one type of filter expression for FilterExpression. expr can be only one of the following:
andGroup

object (FilterExpressionList)

The FilterExpressions in and_group have an AND relationship.

orGroup

object (FilterExpressionList)

The FilterExpressions in or_group have an OR relationship.

notExpression

object (FilterExpression)

The FilterExpression is NOT of not_expression.

filter

object (Filter)

A primitive filter. In the same FilterExpression, all of the filter's field names need to be either all dimensions or all metrics.

FilterExpressionList

JSON representation
{
  "expressions": [
    {
      object (FilterExpression)
    }
  ]
}
Fields
expressions[]

object (FilterExpression)

A list of filter expressions.

Filter

JSON representation
{
  "fieldName": string,

  // Union field one_filter can be only one of the following:
  "stringFilter": {
    object (StringFilter)
  },
  "inListFilter": {
    object (InListFilter)
  },
  "numericFilter": {
    object (NumericFilter)
  },
  "betweenFilter": {
    object (BetweenFilter)
  },
  "emptyFilter": {
    object (EmptyFilter)
  }
  // End of list of possible types for union field one_filter.
}
Fields
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.

Union field one_filter. Specify one type of filter for Filter. one_filter can be only one of the following:
stringFilter

object (StringFilter)

Strings related filter.

inListFilter

object (InListFilter)

A filter for in list values.

numericFilter

object (NumericFilter)

A filter for numeric or date values.

betweenFilter

object (BetweenFilter)

A filter for two values.

emptyFilter

object (EmptyFilter)

A filter for empty values such as "(not set)" and "" values.

StringFilter

JSON representation
{
  "matchType": enum (MatchType),
  "value": string,
  "caseSensitive": boolean
}
Fields
matchType

enum (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.

InListFilter

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

JSON representation
{
  "operation": enum (Operation),
  "value": {
    object (NumericValue)
  }
}
Fields
operation

enum (Operation)

The operation type for this filter.

value

object (NumericValue)

A numeric value or a date value.

NumericValue

JSON representation
{

  // Union field one_value can be only one of the following:
  "int64Value": string,
  "doubleValue": number
  // End of list of possible types for union field one_value.
}
Fields
Union field one_value. One of a numeric value one_value can be only one of the following:
int64Value

string (int64 format)

Integer value

doubleValue

number

Double value

BetweenFilter

JSON representation
{
  "fromValue": {
    object (NumericValue)
  },
  "toValue": {
    object (NumericValue)
  }
}
Fields
fromValue

object (NumericValue)

Begins with this number.

toValue

object (NumericValue)

Ends with this number.

OrderBy

JSON representation
{
  "desc": boolean,

  // Union field one_order_by can be only one of the following:
  "metric": {
    object (MetricOrderBy)
  },
  "dimension": {
    object (DimensionOrderBy)
  },
  "pivot": {
    object (PivotOrderBy)
  }
  // End of list of possible types for union field one_order_by.
}
Fields
desc

boolean

If true, sorts by descending order.

Union field one_order_by. Specify one type of order by for OrderBy. one_order_by can be only one of the following:
metric

object (MetricOrderBy)

Sorts results by a metric's values.

dimension

object (DimensionOrderBy)

Sorts results by a dimension's values.

pivot

object (PivotOrderBy)

Sorts results by a metric's values within a pivot column group.

MetricOrderBy

JSON representation
{
  "metricName": string
}
Fields
metricName

string

A metric name in the request to order by.

DimensionOrderBy

JSON representation
{
  "dimensionName": string,
  "orderType": enum (OrderType)
}
Fields
dimensionName

string

A dimension name in the request to order by.

orderType

enum (OrderType)

Controls the rule for dimension value ordering.

PivotOrderBy

JSON representation
{
  "metricName": string,
  "pivotSelections": [
    {
      object (PivotSelection)
    }
  ]
}
Fields
metricName

string

In the response to order by, order rows by this column. Must be a metric name from the request.

pivotSelections[]

object (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.

PivotSelection

JSON representation
{
  "dimensionName": string,
  "dimensionValue": string
}
Fields
dimensionName

string

Must be a dimension name from the request.

dimensionValue

string

Order by only when the named dimension is this value.

CohortSpec

JSON representation
{
  "cohorts": [
    {
      object (Cohort)
    }
  ],
  "cohortsRange": {
    object (CohortsRange)
  },
  "cohortReportSettings": {
    object (CohortReportSettings)
  }
}
Fields
cohorts[]

object (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 (CohortsRange)

Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.

cohortReportSettings

object (CohortReportSettings)

Optional settings for a cohort report.

Cohort

JSON representation
{
  "name": string,
  "dimension": string,
  "dateRange": {
    object (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 (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

JSON representation
{
  "granularity": enum (Granularity),
  "startOffset": integer,
  "endOffset": integer
}
Fields
granularity

enum (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.

CohortReportSettings

JSON representation
{
  "accumulate": boolean
}
Fields
accumulate

boolean

If true, accumulates the result from first touch day to the end day. Not supported in RunReportRequest.

Comparison

JSON representation
{

  // Union field _name can be only one of the following:
  "name": string
  // End of list of possible types for union field _name.

  // Union field one_comparison can be only one of the following:
  "dimensionFilter": {
    object (FilterExpression)
  },
  "comparison": string
  // End of list of possible types for union field one_comparison.
}
Fields

Union field _name.

_name can be only one of the following:

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.

Union field one_comparison. One kind of comparison value one_comparison can be only one of the following:
dimensionFilter

object (FilterExpression)

A basic comparison.

comparison

string

A saved comparison identified by the comparison's resource name. For example, 'comparisons/1234'.

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.

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

MetricAggregation

Represents aggregation of metrics.

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

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.

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.

Output Schema

The response report table corresponding to a request.

RunReportResponse

JSON representation
{
  "dimensionHeaders": [
    {
      object (DimensionHeader)
    }
  ],
  "metricHeaders": [
    {
      object (MetricHeader)
    }
  ],
  "rows": [
    {
      object (Row)
    }
  ],
  "totals": [
    {
      object (Row)
    }
  ],
  "maximums": [
    {
      object (Row)
    }
  ],
  "minimums": [
    {
      object (Row)
    }
  ],
  "rowCount": integer,
  "metadata": {
    object (ResponseMetaData)
  },
  "propertyQuota": {
    object (PropertyQuota)
  },
  "kind": string
}
Fields
dimensionHeaders[]

object (DimensionHeader)

Describes dimension columns. The number of DimensionHeaders and ordering of DimensionHeaders matches the dimensions present in rows.

metricHeaders[]

object (MetricHeader)

Describes metric columns. The number of MetricHeaders and ordering of MetricHeaders matches the metrics present in rows.

rows[]

object (Row)

Rows of dimension value combinations and metric values in the report.

totals[]

object (Row)

If requested, the totaled values of metrics.

maximums[]

object (Row)

If requested, the maximum values of metrics.

minimums[]

object (Row)

If requested, the minimum values of metrics.

rowCount

integer

The total number of rows in the query result. rowCount is independent of the number of rows returned in the response, the limit request parameter, and the offset request parameter. For example if a query returns 175 rows and includes limit of 50 in the API request, the response will contain rowCount of 175 but only 50 rows.

To learn more about this pagination parameter, see Pagination.

metadata

object (ResponseMetaData)

Metadata for the report.

propertyQuota

object (PropertyQuota)

This Google Analytics property's quota state including this request.

kind

string

Identifies what kind of resource this message is. This kind is always the fixed string "analyticsData#runReport". Useful to distinguish between response types in JSON.

DimensionHeader

JSON representation
{
  "name": string
}
Fields
name

string

The dimension's name.

MetricHeader

JSON representation
{
  "name": string,
  "type": enum (MetricType)
}
Fields
name

string

The metric's name.

type

enum (MetricType)

The metric's data type.

Row

JSON representation
{
  "dimensionValues": [
    {
      object (DimensionValue)
    }
  ],
  "metricValues": [
    {
      object (MetricValue)
    }
  ]
}
Fields
dimensionValues[]

object (DimensionValue)

List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.

metricValues[]

object (MetricValue)

List of requested visible metric values.

DimensionValue

JSON representation
{

  // Union field one_value can be only one of the following:
  "value": string
  // End of list of possible types for union field one_value.
}
Fields
Union field one_value. One kind of dimension value one_value can be only one of the following:
value

string

Value as a string if the dimension type is a string.

MetricValue

JSON representation
{

  // Union field one_value can be only one of the following:
  "value": string
  // End of list of possible types for union field one_value.
}
Fields

Union field one_value.

one_value can be only one of the following:

value

string

Measurement value. See MetricHeader for type.

ResponseMetaData

JSON representation
{
  "dataLossFromOtherRow": boolean,
  "samplingMetadatas": [
    {
      object (SamplingMetadata)
    }
  ],

  // Union field _schema_restriction_response can be only one of the following:
  "schemaRestrictionResponse": {
    object (SchemaRestrictionResponse)
  }
  // End of list of possible types for union field _schema_restriction_response.

  // Union field _currency_code can be only one of the following:
  "currencyCode": string
  // End of list of possible types for union field _currency_code.

  // Union field _time_zone can be only one of the following:
  "timeZone": string
  // End of list of possible types for union field _time_zone.

  // Union field _empty_reason can be only one of the following:
  "emptyReason": string
  // End of list of possible types for union field _empty_reason.

  // Union field _subject_to_thresholding can be only one of the following:
  "subjectToThresholding": boolean
  // End of list of possible types for union field _subject_to_thresholding.
}
Fields
dataLossFromOtherRow

boolean

If true, indicates some buckets of dimension combinations are rolled into "(other)" row. This can happen for high cardinality reports.

The metadata parameter dataLossFromOtherRow is populated based on the aggregated data table used in the report. The parameter will be accurately populated regardless of the filters and limits in the report.

For example, the (other) row could be dropped from the report because the request contains a filter on sessionSource = google. This parameter will still be populated if data loss from other row was present in the input aggregate data used to generate this report.

To learn more, see About the (other) row and data sampling.

samplingMetadatas[]

object (SamplingMetadata)

If this report results is sampled, this describes the percentage of events used in this report. One samplingMetadatas is populated for each date range. Each samplingMetadatas corresponds to a date range in order that date ranges were specified in the request.

However if the results are not sampled, this field will not be defined.

Union field _schema_restriction_response.

_schema_restriction_response can be only one of the following:

schemaRestrictionResponse

object (SchemaRestrictionResponse)

Describes the schema restrictions actively enforced in creating this report. To learn more, see Access and data-restriction management.

Union field _currency_code.

_currency_code can be only one of the following:

currencyCode

string

The currency code used in this report. Intended to be used in formatting currency metrics like purchaseRevenue for visualization. If currency_code was specified in the request, this response parameter will echo the request parameter; otherwise, this response parameter is the property's current currency_code.

Currency codes are string encodings of currency types from the ISO 4217 standard (https://en.wikipedia.org/wiki/ISO_4217); for example "USD", "EUR", "JPY". To learn more, see https://support.google.com/analytics/answer/9796179.

Union field _time_zone.

_time_zone can be only one of the following:

timeZone

string

The property's current timezone. Intended to be used to interpret time-based dimensions like hour and minute. Formatted as strings from the IANA Time Zone database (https://www.iana.org/time-zones); for example "America/New_York" or "Asia/Tokyo".

Union field _empty_reason.

_empty_reason can be only one of the following:

emptyReason

string

If empty reason is specified, the report is empty for this reason.

Union field _subject_to_thresholding.

_subject_to_thresholding can be only one of the following:

subjectToThresholding

boolean

If subjectToThresholding is true, this report is subject to thresholding and only returns data that meets the minimum aggregation thresholds. It is possible for a request to be subject to thresholding thresholding and no data is absent from the report, and this happens when all data is above the thresholds. To learn more, see Data thresholds.

SchemaRestrictionResponse

JSON representation
{
  "activeMetricRestrictions": [
    {
      object (ActiveMetricRestriction)
    }
  ]
}
Fields
activeMetricRestrictions[]

object (ActiveMetricRestriction)

All restrictions actively enforced in creating the report. For example, purchaseRevenue always has the restriction type REVENUE_DATA. However, this active response restriction is only populated if the user's custom role disallows access to REVENUE_DATA.

ActiveMetricRestriction

JSON representation
{
  "restrictedMetricTypes": [
    enum (RestrictedMetricType)
  ],

  // Union field _metric_name can be only one of the following:
  "metricName": string
  // End of list of possible types for union field _metric_name.
}
Fields
restrictedMetricTypes[]

enum (RestrictedMetricType)

The reason for this metric's restriction.

Union field _metric_name.

_metric_name can be only one of the following:

metricName

string

The name of the restricted metric.

SamplingMetadata

JSON representation
{
  "samplesReadCount": string,
  "samplingSpaceSize": string
}
Fields
samplesReadCount

string (int64 format)

The total number of events read in this sampled report for a date range. This is the size of the subset this property's data that was analyzed in this report.

samplingSpaceSize

string (int64 format)

The total number of events present in this property's data that could have been analyzed in this report for a date range. Sampling uncovers the meaningful information about the larger data set, and this is the size of the larger data set.

To calculate the percentage of available data that was used in this report, compute samplesReadCount/samplingSpaceSize.

PropertyQuota

JSON representation
{
  "tokensPerDay": {
    object (QuotaStatus)
  },
  "tokensPerHour": {
    object (QuotaStatus)
  },
  "concurrentRequests": {
    object (QuotaStatus)
  },
  "serverErrorsPerProjectPerHour": {
    object (QuotaStatus)
  },
  "potentiallyThresholdedRequestsPerHour": {
    object (QuotaStatus)
  },
  "tokensPerProjectPerHour": {
    object (QuotaStatus)
  }
}
Fields
tokensPerDay

object (QuotaStatus)

Standard Analytics Properties can use up to 200,000 tokens per day; Analytics 360 Properties can use 2,000,000 tokens per day. Most requests consume fewer than 10 tokens.

tokensPerHour

object (QuotaStatus)

Standard Analytics Properties can use up to 40,000 tokens per hour; Analytics 360 Properties can use 400,000 tokens per hour. An API request consumes a single number of tokens, and that number is deducted from all of the hourly, daily, and per project hourly quotas.

concurrentRequests

object (QuotaStatus)

Standard Analytics Properties can send up to 10 concurrent requests; Analytics 360 Properties can use up to 50 concurrent requests.

serverErrorsPerProjectPerHour

object (QuotaStatus)

Standard Analytics Properties and cloud project pairs can have up to 10 server errors per hour; Analytics 360 Properties and cloud project pairs can have up to 50 server errors per hour.

potentiallyThresholdedRequestsPerHour

object (QuotaStatus)

Analytics Properties can send up to 120 requests with potentially thresholded dimensions per hour. In a batch request, each report request is individually counted for this quota if the request contains potentially thresholded dimensions.

tokensPerProjectPerHour

object (QuotaStatus)

Analytics Properties can use up to 35% of their tokens per project per hour. This amounts to standard Analytics Properties can use up to 14,000 tokens per project per hour, and Analytics 360 Properties can use 140,000 tokens per project per hour. An API request consumes a single number of tokens, and that number is deducted from all of the hourly, daily, and per project hourly quotas.

QuotaStatus

JSON representation
{

  // Union field _consumed can be only one of the following:
  "consumed": integer
  // End of list of possible types for union field _consumed.

  // Union field _remaining can be only one of the following:
  "remaining": integer
  // End of list of possible types for union field _remaining.
}
Fields

Union field _consumed.

_consumed can be only one of the following:

consumed

integer

Quota consumed by this request.

Union field _remaining.

_remaining can be only one of the following:

remaining

integer

Quota remaining after this request.

MetricType

A metric's value type.

Enums
METRIC_TYPE_UNSPECIFIED Unspecified type.
TYPE_INTEGER Integer type.
TYPE_FLOAT Floating point type.
TYPE_SECONDS A duration of seconds; a special floating point type.
TYPE_MILLISECONDS A duration in milliseconds; a special floating point type.
TYPE_MINUTES A duration in minutes; a special floating point type.
TYPE_HOURS A duration in hours; a special floating point type.
TYPE_STANDARD A custom metric of standard type; a special floating point type.
TYPE_CURRENCY An amount of money; a special floating point type.
TYPE_FEET A length in feet; a special floating point type.
TYPE_MILES A length in miles; a special floating point type.
TYPE_METERS A length in meters; a special floating point type.
TYPE_KILOMETERS A length in kilometers; a special floating point type.

RestrictedMetricType

Categories of data that you may be restricted from viewing on certain Google Analytics properties.

Enums
RESTRICTED_METRIC_TYPE_UNSPECIFIED Unspecified type.
COST_DATA Cost metrics such as adCost.
REVENUE_DATA Revenue metrics such as purchaseRevenue.

Tool Annotations

Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ✅