Questions tagged [google-analytics-data-api]

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.

Links

Analytics Data API Overview

31 questions
7
votes
1 answer

User does not have sufficient permissions for this property

I use sample code cd cloudshell_open/nodejs-analytics-data/samples/ node quickstart_json_credentials.js propertyId MY.json propertyId:This site generated MY.json:generated Response is error. 7 PERMISSION_DENIED: User does not have sufficient…
5
votes
1 answer

Does the Google Analytics Embed API support the new GA4 properties?

Does the Google Analytics Embed API (https://developers.google.com/analytics/devguides/reporting/embed/v1) support the new GA4 properties that were just announced this month…
4
votes
2 answers

How do I retrieve the Event Label and Event Value parameters in GA4 using Python api call?

I am using Python API to retrieve information to generate analytics report for an app. We are using the new GA4. Sending the event parameter : Event Category, Event Action, Event Label and Event Value through the gtag.js while triggering the…
4
votes
1 answer

How to authorize Google anlaytics data api with OAuth2

I am trying to connect to the new Google Analytics Data api using C# to request data from the new google analytics GA4. The only sample i can find is Quickstart client libraries .net This does work but it uses a service account. The cloud .net…
3
votes
0 answers

Google Analytics Data API - Path Exploration

Does anybody know if Google Analytics data API provides ability to retrieve "GA4 Path Exploration" data?
3
votes
1 answer

FIltering realtime data by pathname with GA4 Data API

I am working on a realtime dashboard that would fetch data about active users from Google Analytics with Data API (GA4). The feature that I really need is filtering events by pathname. So I would like to display users active in the last 30 minutes…
3
votes
1 answer

Retrieve GA3 and GA4 data with same API?

So we are using Reporting V3 API in our custom dashboard to retrieve custom reports from multiple GA properties. Now some of our customers have GA4 properties which doesn't show up in properties list. Question is, to support both versions (GA3 and…
3
votes
2 answers

403 error when attempting to fetch google analytics 4 data from app script

I am attempting to connect a custom community connector to google analytics 4 in order to get data from analytics and be able to modify it in app script and then send it to data studio. However I am having difficulty connecting and retrieving data…
3
votes
1 answer

When will GA4 Data API be moved to beta?

We are going to create an integration with the GA4 Data API, and are waiting for it to be moved to beta status. Are there any news about when this will happen?
3
votes
1 answer

Python ModuleNotFoundError: No module named 'google.analytics'

I'm trying to use the new Google Data Analytics (https://developers.google.com/analytics/devguides/reporting/data/v1). On my local machine I've got this up and running. However on our Python machine I keep getting the folling error. In from…
2
votes
1 answer

How to filter by dimension using Google Analytics Data API (GA4) Java client library?

I am trying to call Google Analytics Data API (GA4) using the Java client library and applying a dimension filter. This is the call which is working if I don't use the setDimensionFilter call: RunReportRequest request = …
2
votes
1 answer

Is there any way to create report data from google analytics in angular?

i used to options and failed in angular first case :I try used GA4 to get data but not work https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/runRealtimeReport and return error : { "error": { "code":…
2
votes
1 answer

Custom dimensions on Google Analytics Data API (GA4) Python

I am trying to make a report using the quickstart code described Here, it works perfectly, but when I try to add a custom dimension, I obtain the following Error google.api_core.exceptions.InvalidArgument: 400 Field uid is not a valid dimension.…
2
votes
2 answers

What is the ga:visits equivalent in GA4?

I'm seeing the list of metrics available in GA4, and am looking for the "ga:visits" equivalent for GA4 but that seems to be missing.
1
vote
0 answers

Google Analytics Data API - not able to set empty Filters in request in C#.NET

I'm using the Google Analytics Data API v1 beta to fetch GA4 properties' data in C#.NET. And I'm initializing the filters for it like this: FilterExpression dimensionFilterExpression = new FilterExpression(); FilterExpression metricFilterExpression…
1
2 3