0

I want just to get count of active users and display it on my own dashboard, but I cant find any way how to do this.

I found https://developers.google.com/analytics/devguides/reporting/realtime/v3/reference/data/realtime/get

but I need some viewId and I use web+app type for my analytics so I dont have this viewId.

How can I access to this number ? How can I just get count of active users that I see on dashboard.

Yura Bysaha
  • 721
  • 6
  • 17

2 Answers2

2

There is currently no reporting API for App+Web, it's in beta so you should use this new property in parallel with the known one.

However, you can configure a BigQuery Export and link that dataset to Data Studio: https://www.simoahava.com/analytics/enable-bigquery-export-google-analytics-app-web/

Michele Pisani
  • 13,567
  • 3
  • 25
  • 42
1

If you want the number of active users in the last 30 minutes, there is a REST API for that. Specifically, there is a Realtime API for GA4 Properties.

This developer site provides an introduction to creating a realtime report: https://developers.google.com/analytics/trusted-testing/analytics-data/realtime-basics. If you are interested in Active Users counts for your app or website, you can send API requests with just the metric "Active Users". For example, send the following request:

POST https://analyticsdata.googleapis.com/v1alpha/properties/YOUR_PROPERTY_ID:runRealtimeReport
{
  "metrics": [{ "name": "activeUsers" }]
}

There is a separate Realtime rest API for views; as you linked, https://developers.google.com/analytics/devguides/reporting/realtime/v3/reference/data/realtime/get. GA4 Properties do not have views.

Brett
  • 1,189
  • 4
  • 12