Skip to main content
Server path: /google-analytics-data | Type: Application | PCID required: Yes

Tools

ToolDescription
google-analytics-data_batch_run_pivot_reportsReturns multiple pivot reports in a batch. All reports must be for the same GA4 Property.
google-analytics-data_batch_run_reportsReturns multiple reports in a batch. All reports must be for the same GA4 Property.
google-analytics-data_check_compatibilityThis 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_metadataReturns 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_reportReturns 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_reportReturns 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_reportReturns 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:
ParameterTypeRequiredDefaultDescription
propertystringYesA 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
requestsobject[]YesIndividual requests. Each request has a separate pivot report response. Each batch request is allowed up to 5 requests.

google-analytics-data_batch_run_reports

Returns multiple reports in a batch. All reports must be for the same GA4 Property. Parameters:
ParameterTypeRequiredDefaultDescription
propertystringYesA 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
requestsobject[]YesIndividual requests. Each request has a separate report response. Each batch request is allowed up to 5 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:
ParameterTypeRequiredDefaultDescription
propertystringYesA 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
compatibilityFilterstringNoFilters the dimensions and metrics in the response to just this compatibility. Commonly used as ”compatibilityFilter”: “COMPATIBLE” to only return compatible dimensions & metrics.
dimensionFilterobjectNoTo express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.
dimensionsobject[]NoThe dimensions in this report. dimensions should be the same value as in your runReport request.
metricFilterobjectNoTo express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.
metricsobject[]NoThe metrics in this report. metrics should be the same value as in your runReport request.

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. Parameters:
ParameterTypeRequiredDefaultDescription
namestringYesRequired. 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.

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:
ParameterTypeRequiredDefaultDescription
propertystringYesA 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
cohortSpecobjectNoThe 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.
currencyCodestringNoA currency code in ISO4217 format, such as “AED”, “USD”, “JPY”. If the field is empty, the report uses the property’s default currency.
dateRangesobject[]NoThe 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.
dimensionFilterobjectNoTo express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.
dimensionsobject[]NoThe dimensions requested. All defined dimensions must be used by one of the following: dimension_expression, dimension_filter, pivots, order_bys.
keepEmptyRowsbooleanNoIf 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.
metricFilterobjectNoTo express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.
metricsobject[]NoThe 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.
pivotsobject[]NoDescribes 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.
returnPropertyQuotabooleanNoToggles whether to return the current state of this Analytics Property’s quota. Quota is returned in PropertyQuota.

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:
ParameterTypeRequiredDefaultDescription
propertystringYesA 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
dimensionFilterobjectNoTo express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.
dimensionsobject[]NoThe dimensions requested and displayed.
limitstringNoThe 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.
metricAggregationsstring[]NoAggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to “RESERVED_(MetricAggregation)”.
metricFilterobjectNoTo express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.
metricsobject[]NoThe metrics requested and displayed.
minuteRangesobject[]NoThe 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.
orderBysobject[]NoSpecifies how rows are ordered in the response.
returnPropertyQuotabooleanNoToggles whether to return the current state of this Analytics Property’s Realtime quota. Quota is returned in PropertyQuota.

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:
ParameterTypeRequiredDefaultDescription
propertystringYesA 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
cohortSpecobjectNoThe 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.
currencyCodestringNoA currency code in ISO4217 format, such as “AED”, “USD”, “JPY”. If the field is empty, the report uses the property’s default currency.
dateRangesobject[]NoDate 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.
dimensionFilterobjectNoTo express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.
dimensionsobject[]NoThe dimensions requested and displayed.
keepEmptyRowsbooleanNoIf 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.
limitstringNoThe 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.
metricAggregationsstring[]NoAggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to “RESERVED_(MetricAggregation)”.
metricFilterobjectNoTo express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.
metricsobject[]NoThe metrics requested and displayed.
offsetstringNoThe 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.
orderBysobject[]NoSpecifies how rows are ordered in the response.
returnPropertyQuotabooleanNoToggles whether to return the current state of this Analytics Property’s quota. Quota is returned in PropertyQuota.