The Google Analytics Data API provides programmatic methods to access report data in Google Analytics GA4 properties. "Warning: This API currently provides features available in Alpha and Beta channels."
This API currently provides features available in Alpha and Beta channels.
The Google Analytics Data API provides programmatic methods to access report data in Google Analytics GA4 properties. With the Google Analytics Data API, you can:
- Build custom dashboards to display Google Analytics data.
- Automate complex reporting tasks to save time.
- Integrate your Google Analytics data with other business applications.
Available methods
runReport
This method returns a customized report of your Google Analytics event data and is the preferred method for simple report queries.batchRunReports
This is a batch version of the runReport method which allows generating multiple reports using a single API call.runPivotReport
This method returns a customized pivot report of you Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. Each pivot describes the visible dimension columns and rows in the report response.batchRunPivotReports
This is a batch version of the runPivotReport method which allows generating multiple reports using a single API call.getMetadata
This method returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. The response of this method also includes the Custom dimensions and metrics available for the specified GA4 property.runRealtimeReport
This method 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).runFunnelReport
(Early preview) This method returns a customized funnel report of your Google Analytics event data. Funnel exploration lets you visualize the steps your users take to complete a task and quickly see how well they are succeeding or failing at each step.