-
Google Analytics 4: How to Get the Most Out of the Minute Dimension
Hey there, I was looking at how to request a ‘minute’ from this guide: https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions. But when I tried to use this in the GA4 API, I got an error that said my request’s dimensions and metrics are not getting along and I should drop ‘minute’. Here’s the error I got:
Error: InvalidArgument 400 - "Please remove minute to make the request compatible. The request's dimensions & metrics are incompatible. To learn more, see https://ga-dev-tools.web.app/ga4/dimensions-metrics-explorer/" . . . "UNKNOWN:Error received from peer ipv6:%5B2800:3f0:4001:833::200a%5D:443 {grpc_message:"Please remove minute to make the request compatible. The request's dimensions & metrics are incompatible. To learn more, see https://ga-dev-tools.web.app/ga4/dimensions-metrics-explorer/", grpc_status:3, created_time:"2023-05-09T10:37:02.0337-03:00"}"
And I was trying to do this:
from google.analytics.data_v1beta import BetaAnalyticsDataClient from google.analytics.data_v1beta.types import ( DateRange, Dimension, Metric, RunReportRequest, ) def run_sample(property_id="YOUR-GA4-PROPERTY-ID"): client = BetaAnalyticsDataClient() request = RunReportRequest( property=f"properties/{property_id}", dimensions=[Dimension(name="minute")], metrics=[Metric(name="activeUsers")], date_ranges=[DateRange(start_date="2020-09-01", end_date="2020-09-15")], ) response = client.run_report(request) run_sample("YOUR-GA4-PROPERTY-ID")
Can anyone help?
Log in to reply.