/google-analytics-data | Type: Application | PCID required: Yes
Tools
| Tool | Description |
|---|---|
google-analytics-data_batch_run_pivot_reports | Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property. |
google-analytics-data_batch_run_reports | Returns multiple reports in a batch. All reports must be for the same GA4 Property. |
google-analytics-data_check_compatibility | This compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility. This method fails if the request’s dimensions and metrics are incompatible. In Google Analytics, reports fail if they request incompatible dimensions and/or metrics; in that case, you will need to remove dimensions and/or metrics from the incompatible report until the report is compatible. The Realtime and Core reports have different compatibility rules. This method checks compatibility for Core reports. |
google-analytics-data_get_metadata | Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata. For example if a custom metric with parameter name levels_unlocked is registered to a property, the Metadata response will contain customEvent:levels_unlocked. Universal metadata are dimensions and metrics applicable to any property such as country and totalUsers. |
google-analytics-data_run_pivot_report | 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. |
google-analytics-data_run_realtime_report | Returns a customized report of realtime event data for your property. Events appear in realtime reports seconds after they have been sent to the Google Analytics. Realtime reports show events and usage data for the periods of time ranging from the present moment to 30 minutes ago (up to 60 minutes for Google Analytics 360 properties). For a guide to constructing realtime requests & understanding responses, see Creating a Realtime Report. |
google-analytics-data_run_report | Returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name. For a guide to constructing requests & understanding responses, see Creating a Report. |
google-analytics-data_batch_run_pivot_reports
Returns multiple pivot reports in a batch. All reports must be for the same GA4 Property. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
property | string | Yes | — | A Google Analytics GA4 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. This property must be specified for the batch. The property within RunPivotReportRequest may either be unspecified or consistent with this property. Example: properties/1234 |
requests | object[] | Yes | — | Individual requests. Each request has a separate pivot report response. Each batch request is allowed up to 5 requests. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"property": {
"type": "string",
"description": "A Google Analytics GA4 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). This property must be specified for the batch. The property within RunPivotReportRequest may either be unspecified or consistent with this property. Example: properties/1234"
},
"requests": {
"type": "array",
"items": {
"type": "object",
"properties": {
"cohortSpec": {
"type": "object",
"description": "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."
},
"currencyCode": {
"type": "string",
"description": "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": {
"type": "array",
"items": {
"type": "object",
"properties": {
"endDate": {
"type": "string",
"description": "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": {
"type": "string",
"description": "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."
},
"startDate": {
"type": "string",
"description": "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."
}
}
},
"description": "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."
},
"dimensionFilter": {
"type": "object",
"description": "To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics."
},
"dimensions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"dimensionExpression": {
"type": "object",
"description": "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)."
},
"name": {
"type": "string",
"description": "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. 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`."
}
}
},
"description": "The dimensions requested. All defined dimensions must be used by one of the following: dimension_expression, dimension_filter, pivots, order_bys."
},
"keepEmptyRows": {
"type": "boolean",
"description": "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 (GA4) 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."
},
"metricFilter": {
"type": "object",
"description": "To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics."
},
"metrics": {
"type": "array",
"items": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "A mathematical expression for derived metrics. For example, the metric Event count per user is `eventCount/totalUsers`."
},
"invisible": {
"type": "boolean",
"description": "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`."
},
"name": {
"type": "string",
"description": "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. 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`."
}
}
},
"description": "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."
},
"pivots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fieldNames": {
"type": "array",
"description": "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."
},
"limit": {
"type": "string",
"description": "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": {
"type": "array",
"description": "Aggregate the metrics by dimensions in this pivot using the specified metric_aggregations."
},
"offset": {
"type": "string",
"description": "The row count of the start row. The first row is counted as row 0."
},
"orderBys": {
"type": "array",
"description": "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."
}
}
},
"description": "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."
},
"property": {
"type": "string",
"description": "A Google Analytics GA4 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"
},
"returnPropertyQuota": {
"type": "boolean",
"description": "Toggles whether to return the current state of this Analytics Property's quota. Quota is returned in [PropertyQuota](#PropertyQuota)."
}
}
},
"description": "Individual requests. Each request has a separate pivot report response. Each batch request is allowed up to 5 requests."
}
},
"required": [
"PCID",
"property",
"requests"
]
}
google-analytics-data_batch_run_reports
Returns multiple reports in a batch. All reports must be for the same GA4 Property. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
property | string | Yes | — | A Google Analytics GA4 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. This property must be specified for the batch. The property within RunReportRequest may either be unspecified or consistent with this property. Example: properties/1234 |
requests | object[] | Yes | — | Individual requests. Each request has a separate report response. Each batch request is allowed up to 5 requests. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"property": {
"type": "string",
"description": "A Google Analytics GA4 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). This property must be specified for the batch. The property within RunReportRequest may either be unspecified or consistent with this property. Example: properties/1234"
},
"requests": {
"type": "array",
"items": {
"type": "object",
"properties": {
"cohortSpec": {
"type": "object",
"description": "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."
},
"currencyCode": {
"type": "string",
"description": "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": {
"type": "array",
"items": {
"type": "object",
"properties": {
"endDate": {
"type": "string",
"description": "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": {
"type": "string",
"description": "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."
},
"startDate": {
"type": "string",
"description": "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."
}
}
},
"description": "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": {
"type": "object",
"description": "To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics."
},
"dimensions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"dimensionExpression": {
"type": "object",
"description": "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)."
},
"name": {
"type": "string",
"description": "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. 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`."
}
}
},
"description": "The dimensions requested and displayed."
},
"keepEmptyRows": {
"type": "boolean",
"description": "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 (GA4) 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."
},
"limit": {
"type": "string",
"format": "int64",
"description": "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](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination)."
},
"metricAggregations": {
"type": "array",
"items": {
"type": "string"
},
"description": "Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to \"RESERVED_(MetricAggregation)\"."
},
"metricFilter": {
"type": "object",
"description": "To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics."
},
"metrics": {
"type": "array",
"items": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "A mathematical expression for derived metrics. For example, the metric Event count per user is `eventCount/totalUsers`."
},
"invisible": {
"type": "boolean",
"description": "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`."
},
"name": {
"type": "string",
"description": "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. 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`."
}
}
},
"description": "The metrics requested and displayed."
},
"offset": {
"type": "string",
"format": "int64",
"description": "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](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination)."
},
"orderBys": {
"type": "array",
"items": {
"type": "object",
"properties": {
"desc": {
"type": "boolean",
"description": "If true, sorts by descending order."
},
"dimension": {
"type": "object",
"description": "Sorts by dimension values."
},
"metric": {
"type": "object",
"description": "Sorts by metric values."
},
"pivot": {
"type": "object",
"description": "Sorts by a pivot column group."
}
}
},
"description": "Specifies how rows are ordered in the response."
},
"returnPropertyQuota": {
"type": "boolean",
"description": "Toggles whether to return the current state of this Analytics Property's quota. Quota is returned in [PropertyQuota](#PropertyQuota)."
}
}
},
"description": "Individual requests. Each request has a separate report response. Each batch request is allowed up to 5 requests."
}
},
"required": [
"PCID",
"property",
"requests"
]
}
google-analytics-data_check_compatibility
This compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility. This method fails if the request’s dimensions and metrics are incompatible. In Google Analytics, reports fail if they request incompatible dimensions and/or metrics; in that case, you will need to remove dimensions and/or metrics from the incompatible report until the report is compatible. The Realtime and Core reports have different compatibility rules. This method checks compatibility for Core reports. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
property | string | Yes | — | A Google Analytics GA4 property identifier whose events are tracked. To learn more, see where to find your Property ID. property should be the same value as in your runReport request. Example: properties/1234 |
compatibilityFilter | string | No | — | Filters the dimensions and metrics in the response to just this compatibility. Commonly used as ”compatibilityFilter”: “COMPATIBLE” to only return compatible dimensions & metrics. |
dimensionFilter | object | No | — | To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. |
dimensions | object[] | No | — | The dimensions in this report. dimensions should be the same value as in your runReport request. |
metricFilter | object | No | — | To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. |
metrics | object[] | No | — | The metrics in this report. metrics should be the same value as in your runReport request. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"property": {
"type": "string",
"description": "A Google Analytics GA4 property identifier whose events are tracked. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). `property` should be the same value as in your `runReport` request. Example: properties/1234"
},
"compatibilityFilter": {
"type": "string",
"description": "Filters the dimensions and metrics in the response to just this compatibility. Commonly used as `”compatibilityFilter”: “COMPATIBLE”` to only return compatible dimensions & metrics.",
"enum": [
"COMPATIBILITY_UNSPECIFIED",
"COMPATIBLE",
"INCOMPATIBLE"
]
},
"dimensionFilter": {
"type": "object",
"description": "To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.",
"properties": {
"andGroup": {
"type": "object",
"description": "A list of filter expressions."
},
"filter": {
"type": "object",
"description": "An expression to filter dimension or metric values."
},
"notExpression": {
"type": "object",
"description": "Circular schema reference: #/components/schemas/FilterExpression"
},
"orGroup": {
"type": "object",
"description": "A list of filter expressions."
}
}
},
"dimensions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"dimensionExpression": {
"type": "object",
"description": "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)."
},
"name": {
"type": "string",
"description": "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. 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`."
}
}
},
"description": "The dimensions in this report. `dimensions` should be the same value as in your `runReport` request."
},
"metricFilter": {
"type": "object",
"description": "To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.",
"properties": {
"andGroup": {
"type": "object",
"description": "A list of filter expressions."
},
"filter": {
"type": "object",
"description": "An expression to filter dimension or metric values."
},
"notExpression": {
"type": "object",
"description": "Circular schema reference: #/components/schemas/FilterExpression"
},
"orGroup": {
"type": "object",
"description": "A list of filter expressions."
}
}
},
"metrics": {
"type": "array",
"items": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "A mathematical expression for derived metrics. For example, the metric Event count per user is `eventCount/totalUsers`."
},
"invisible": {
"type": "boolean",
"description": "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`."
},
"name": {
"type": "string",
"description": "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. 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`."
}
}
},
"description": "The metrics in this report. `metrics` should be the same value as in your `runReport` request."
}
},
"required": [
"PCID",
"property"
]
}
google-analytics-data_get_metadata
Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata. For example if a custom metric with parameter namelevels_unlocked is registered to a property, the Metadata response will contain customEvent:levels_unlocked. Universal metadata are dimensions and metrics applicable to any property such as country and totalUsers.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see where to find your Property ID. Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"name": {
"type": "string",
"description": "Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics."
}
},
"required": [
"PCID",
"name"
]
}
google-analytics-data_run_pivot_report
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. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
property | string | Yes | — | A Google Analytics GA4 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 |
cohortSpec | object | No | — | 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. 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. |
currencyCode | string | No | — | 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 | object[] | No | — | 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. |
dimensionFilter | object | No | — | To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. |
dimensions | object[] | No | — | The dimensions requested. All defined dimensions must be used by one of the following: dimension_expression, dimension_filter, pivots, order_bys. |
keepEmptyRows | boolean | No | — | 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 (GA4) 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. |
metricFilter | object | No | — | To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. |
metrics | object[] | No | — | 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. |
pivots | object[] | No | — | 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. |
returnPropertyQuota | boolean | No | — | Toggles whether to return the current state of this Analytics Property’s quota. Quota is returned in PropertyQuota. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"property": {
"type": "string",
"description": "A Google Analytics GA4 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"
},
"cohortSpec": {
"type": "object",
"description": "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.",
"properties": {
"cohortReportSettings": {
"type": "object",
"description": "Optional settings of a cohort report."
},
"cohorts": {
"type": "array",
"items": {
"type": "object"
},
"description": "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": {
"type": "object",
"description": "Configures the extended reporting date range for a cohort report. Specifies an offset duration to follow the cohorts over."
}
}
},
"currencyCode": {
"type": "string",
"description": "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": {
"type": "array",
"items": {
"type": "object",
"properties": {
"endDate": {
"type": "string",
"description": "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": {
"type": "string",
"description": "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."
},
"startDate": {
"type": "string",
"description": "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."
}
}
},
"description": "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."
},
"dimensionFilter": {
"type": "object",
"description": "To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.",
"properties": {
"andGroup": {
"type": "object",
"description": "A list of filter expressions."
},
"filter": {
"type": "object",
"description": "An expression to filter dimension or metric values."
},
"notExpression": {
"type": "object",
"description": "Circular schema reference: #/components/schemas/FilterExpression"
},
"orGroup": {
"type": "object",
"description": "A list of filter expressions."
}
}
},
"dimensions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"dimensionExpression": {
"type": "object",
"description": "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)."
},
"name": {
"type": "string",
"description": "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. 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`."
}
}
},
"description": "The dimensions requested. All defined dimensions must be used by one of the following: dimension_expression, dimension_filter, pivots, order_bys."
},
"keepEmptyRows": {
"type": "boolean",
"description": "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 (GA4) 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."
},
"metricFilter": {
"type": "object",
"description": "To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.",
"properties": {
"andGroup": {
"type": "object",
"description": "A list of filter expressions."
},
"filter": {
"type": "object",
"description": "An expression to filter dimension or metric values."
},
"notExpression": {
"type": "object",
"description": "Circular schema reference: #/components/schemas/FilterExpression"
},
"orGroup": {
"type": "object",
"description": "A list of filter expressions."
}
}
},
"metrics": {
"type": "array",
"items": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "A mathematical expression for derived metrics. For example, the metric Event count per user is `eventCount/totalUsers`."
},
"invisible": {
"type": "boolean",
"description": "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`."
},
"name": {
"type": "string",
"description": "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. 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`."
}
}
},
"description": "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."
},
"pivots": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fieldNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "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."
},
"limit": {
"type": "string",
"format": "int64",
"description": "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": {
"type": "array",
"items": {
"type": "string"
},
"description": "Aggregate the metrics by dimensions in this pivot using the specified metric_aggregations."
},
"offset": {
"type": "string",
"format": "int64",
"description": "The row count of the start row. The first row is counted as row 0."
},
"orderBys": {
"type": "array",
"items": {
"type": "object",
"properties": {
"desc": {
"type": "boolean",
"description": "If true, sorts by descending order."
},
"dimension": {
"type": "object",
"description": "Sorts by dimension values."
},
"metric": {
"type": "object",
"description": "Sorts by metric values."
},
"pivot": {
"type": "object",
"description": "Sorts by a pivot column group."
}
}
},
"description": "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."
}
}
},
"description": "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."
},
"returnPropertyQuota": {
"type": "boolean",
"description": "Toggles whether to return the current state of this Analytics Property's quota. Quota is returned in [PropertyQuota](#PropertyQuota)."
}
},
"required": [
"PCID",
"property"
]
}
google-analytics-data_run_realtime_report
Returns a customized report of realtime event data for your property. Events appear in realtime reports seconds after they have been sent to the Google Analytics. Realtime reports show events and usage data for the periods of time ranging from the present moment to 30 minutes ago (up to 60 minutes for Google Analytics 360 properties). For a guide to constructing realtime requests & understanding responses, see Creating a Realtime Report. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
property | string | Yes | — | A Google Analytics GA4 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. Example: properties/1234 |
dimensionFilter | object | No | — | To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. |
dimensions | object[] | No | — | The dimensions requested and displayed. |
limit | string | No | — | 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. |
metricAggregations | string[] | No | — | Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to “RESERVED_(MetricAggregation)”. |
metricFilter | object | No | — | To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. |
metrics | object[] | No | — | The metrics requested and displayed. |
minuteRanges | object[] | No | — | The minute ranges of event data to read. If unspecified, one minute range for the last 30 minutes will be used. If multiple minute ranges are requested, each response row will contain a zero based minute range index. If two minute ranges overlap, the event data for the overlapping minutes is included in the response rows for both minute ranges. |
orderBys | object[] | No | — | Specifies how rows are ordered in the response. |
returnPropertyQuota | boolean | No | — | Toggles whether to return the current state of this Analytics Property’s Realtime quota. Quota is returned in PropertyQuota. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"property": {
"type": "string",
"description": "A Google Analytics GA4 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). Example: properties/1234"
},
"dimensionFilter": {
"type": "object",
"description": "To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.",
"properties": {
"andGroup": {
"type": "object",
"description": "A list of filter expressions."
},
"filter": {
"type": "object",
"description": "An expression to filter dimension or metric values."
},
"notExpression": {
"type": "object",
"description": "Circular schema reference: #/components/schemas/FilterExpression"
},
"orGroup": {
"type": "object",
"description": "A list of filter expressions."
}
}
},
"dimensions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"dimensionExpression": {
"type": "object",
"description": "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)."
},
"name": {
"type": "string",
"description": "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. 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`."
}
}
},
"description": "The dimensions requested and displayed."
},
"limit": {
"type": "string",
"description": "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."
},
"metricAggregations": {
"type": "array",
"items": {
"type": "string",
"enum": [
"METRIC_AGGREGATION_UNSPECIFIED",
"TOTAL",
"MINIMUM",
"MAXIMUM",
"COUNT"
]
},
"description": "Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to \"RESERVED_(MetricAggregation)\"."
},
"metricFilter": {
"type": "object",
"description": "To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.",
"properties": {
"andGroup": {
"type": "object",
"description": "A list of filter expressions."
},
"filter": {
"type": "object",
"description": "An expression to filter dimension or metric values."
},
"notExpression": {
"type": "object",
"description": "Circular schema reference: #/components/schemas/FilterExpression"
},
"orGroup": {
"type": "object",
"description": "A list of filter expressions."
}
}
},
"metrics": {
"type": "array",
"items": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "A mathematical expression for derived metrics. For example, the metric Event count per user is `eventCount/totalUsers`."
},
"invisible": {
"type": "boolean",
"description": "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`."
},
"name": {
"type": "string",
"description": "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. 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`."
}
}
},
"description": "The metrics requested and displayed."
},
"minuteRanges": {
"type": "array",
"items": {
"type": "object",
"properties": {
"endMinutesAgo": {
"type": "integer",
"format": "int32",
"description": "The inclusive end minute for the query as a number of minutes before now. Cannot be before `startMinutesAgo`. For example, `\"endMinutesAgo\": 15` specifies the report should include event data from prior to 15 minutes ago. If unspecified, `endMinutesAgo` is defaulted to 0. Standard Analytics properties can request any minute in the last 30 minutes of event data (`endMinutesAgo <= 29`), and 360 Analytics properties can request any minute in the last 60 minutes of event data (`endMinutesAgo <= 59`)."
},
"name": {
"type": "string",
"description": "Assigns a name to this minute 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, minute ranges are named by their zero based index in the request: `date_range_0`, `date_range_1`, etc."
},
"startMinutesAgo": {
"type": "integer",
"format": "int32",
"description": "The inclusive start minute for the query as a number of minutes before now. For example, `\"startMinutesAgo\": 29` specifies the report should include event data from 29 minutes ago and after. Cannot be after `endMinutesAgo`. If unspecified, `startMinutesAgo` is defaulted to 29. Standard Analytics properties can request up to the last 30 minutes of event data (`startMinutesAgo <= 29`), and 360 Analytics properties can request up to the last 60 minutes of event data (`startMinutesAgo <= 59`)."
}
}
},
"description": "The minute ranges of event data to read. If unspecified, one minute range for the last 30 minutes will be used. If multiple minute ranges are requested, each response row will contain a zero based minute range index. If two minute ranges overlap, the event data for the overlapping minutes is included in the response rows for both minute ranges."
},
"orderBys": {
"type": "array",
"items": {
"type": "object",
"properties": {
"desc": {
"type": "boolean",
"description": "If true, sorts by descending order."
},
"dimension": {
"type": "object",
"description": "Sorts by dimension values."
},
"metric": {
"type": "object",
"description": "Sorts by metric values."
},
"pivot": {
"type": "object",
"description": "Sorts by a pivot column group."
}
}
},
"description": "Specifies how rows are ordered in the response."
},
"returnPropertyQuota": {
"type": "boolean",
"description": "Toggles whether to return the current state of this Analytics Property's Realtime quota. Quota is returned in [PropertyQuota](#PropertyQuota)."
}
},
"required": [
"PCID",
"property"
]
}
google-analytics-data_run_report
Returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name. For a guide to constructing requests & understanding responses, see Creating a Report. Parameters:| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
property | string | Yes | — | A Google Analytics GA4 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 |
cohortSpec | object | No | — | 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. 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. |
currencyCode | string | No | — | 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 | object[] | No | — | 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 | No | — | To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. |
dimensions | object[] | No | — | The dimensions requested and displayed. |
keepEmptyRows | boolean | No | — | 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 (GA4) 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. |
limit | string | No | — | 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 | string[] | No | — | Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to “RESERVED_(MetricAggregation)”. |
metricFilter | object | No | — | To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. |
metrics | object[] | No | — | The metrics requested and displayed. |
offset | string | No | — | 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. |
orderBys | object[] | No | — | Specifies how rows are ordered in the response. |
returnPropertyQuota | boolean | No | — | Toggles whether to return the current state of this Analytics Property’s quota. Quota is returned in PropertyQuota. |
Show inputSchema
Show inputSchema
{
"type": "object",
"properties": {
"PCID": {
"type": "string",
"description": "Pink Connect ID for the authenticated connection"
},
"property": {
"type": "string",
"description": "A Google Analytics GA4 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"
},
"cohortSpec": {
"type": "object",
"description": "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.",
"properties": {
"cohortReportSettings": {
"type": "object",
"description": "Optional settings of a cohort report."
},
"cohorts": {
"type": "array",
"items": {
"type": "object"
},
"description": "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": {
"type": "object",
"description": "Configures the extended reporting date range for a cohort report. Specifies an offset duration to follow the cohorts over."
}
}
},
"currencyCode": {
"type": "string",
"description": "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": {
"type": "array",
"items": {
"type": "object",
"properties": {
"endDate": {
"type": "string",
"description": "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": {
"type": "string",
"description": "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."
},
"startDate": {
"type": "string",
"description": "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."
}
}
},
"description": "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": {
"type": "object",
"description": "To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.",
"properties": {
"andGroup": {
"type": "object",
"description": "A list of filter expressions."
},
"filter": {
"type": "object",
"description": "An expression to filter dimension or metric values."
},
"notExpression": {
"type": "object",
"description": "Circular schema reference: #/components/schemas/FilterExpression"
},
"orGroup": {
"type": "object",
"description": "A list of filter expressions."
}
}
},
"dimensions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"dimensionExpression": {
"type": "object",
"description": "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)."
},
"name": {
"type": "string",
"description": "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. 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`."
}
}
},
"description": "The dimensions requested and displayed."
},
"keepEmptyRows": {
"type": "boolean",
"description": "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 (GA4) 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."
},
"limit": {
"type": "string",
"description": "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](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination)."
},
"metricAggregations": {
"type": "array",
"items": {
"type": "string",
"enum": [
"METRIC_AGGREGATION_UNSPECIFIED",
"TOTAL",
"MINIMUM",
"MAXIMUM",
"COUNT"
]
},
"description": "Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to \"RESERVED_(MetricAggregation)\"."
},
"metricFilter": {
"type": "object",
"description": "To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.",
"properties": {
"andGroup": {
"type": "object",
"description": "A list of filter expressions."
},
"filter": {
"type": "object",
"description": "An expression to filter dimension or metric values."
},
"notExpression": {
"type": "object",
"description": "Circular schema reference: #/components/schemas/FilterExpression"
},
"orGroup": {
"type": "object",
"description": "A list of filter expressions."
}
}
},
"metrics": {
"type": "array",
"items": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "A mathematical expression for derived metrics. For example, the metric Event count per user is `eventCount/totalUsers`."
},
"invisible": {
"type": "boolean",
"description": "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`."
},
"name": {
"type": "string",
"description": "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. 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`."
}
}
},
"description": "The metrics requested and displayed."
},
"offset": {
"type": "string",
"description": "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](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination)."
},
"orderBys": {
"type": "array",
"items": {
"type": "object",
"properties": {
"desc": {
"type": "boolean",
"description": "If true, sorts by descending order."
},
"dimension": {
"type": "object",
"description": "Sorts by dimension values."
},
"metric": {
"type": "object",
"description": "Sorts by metric values."
},
"pivot": {
"type": "object",
"description": "Sorts by a pivot column group."
}
}
},
"description": "Specifies how rows are ordered in the response."
},
"returnPropertyQuota": {
"type": "boolean",
"description": "Toggles whether to return the current state of this Analytics Property's quota. Quota is returned in [PropertyQuota](#PropertyQuota)."
}
},
"required": [
"PCID",
"property"
]
}

