{
"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"
]
}