Analytics

Run a Google Analytics (GA4) realtime report

Changed on

Activity on a connected GA4 property in the last 30 minutes (up to 60 for Analytics 360), through Google's runRealtimeReport. Not cached. Only realtime dimensions and metrics are accepted, e.g. country, unifiedScreenName with activeUsers.

post/v1/analytics/googleanalytics/realtime

Request

  • Base URL
    https://zernio.com/api
  • URL
    https://zernio.com/api/v1/analytics/googleanalytics/realtime
  • Auth
    HTTP bearer

Request body

accountIdstring required

Zernio account ID of the Google Analytics connection (platform googleanalytics).

dimensionsstring[]

GA4 dimension API names, e.g. date, sessionSource, pagePath. List them with GET /v1/analytics/googleanalytics/metadata.

metricsstring[] required

GA4 metric API names, e.g. sessions, activeUsers, keyEvents, totalRevenue.

dimensionFilterobject

A Google FilterExpression on dimensions, in Google's own shape.

metricFilterobject

A Google FilterExpression on metrics, in Google's own shape.

orderBysobject[]

Google OrderBy objects, e.g. { "metric": { "metricName": "sessions" }, "desc": true }.

limitinteger

Rows to return. Defaults to Google's default (10000).

Example request

{
  "dimensions": [
    "date",
    "sessionDefaultChannelGroup"
  ],
  "metrics": [
    "sessions",
    "activeUsers"
  ]
}

Response

Realtime report rows from Google

accountIdstring

Zernio account ID of the Google Analytics connection.

propertyIdstring

Numeric GA4 property ID.

rowCountinteger

Total rows matching the request, across all pages.

metadataobject

Google report metadata (currency, time zone, sampling and thresholding flags).

propertyQuotaobject

Google quota left on this property after the request (tokens per day and per hour, concurrent requests). Cached responses carry the quota from when they were fetched.

Changes