Take our developer survey. We want your feedback so we can learn how to improve Google Analytics, and make it an even better tool for you.

Method: properties.runRealtimeReport

The Google Analytics Realtime API returns a customized report of realtime event data for your property. These reports show events and usage from the last 30 minutes.

HTTP request

POST https://analyticsdata.googleapis.com/v1alpha/{property=properties/*}:runRealtimeReport

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
property

string

A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see where to find your Property ID.

Example: properties/1234

Request body

The request body contains data with the following structure:

JSON representation
{
  "dimensions": [
    {
      object (Dimension)
    }
  ],
  "metrics": [
    {
      object (Metric)
    }
  ],
  "limit": string,
  "dimensionFilter": {
    object (FilterExpression)
  },
  "metricFilter": {
    object (FilterExpression)
  },
  "metricAggregations": [
    enum (MetricAggregation)
  ],
  "orderBys": [
    {
      object (OrderBy)
    }
  ],
  "returnPropertyQuota": boolean
}
Fields
dimensions[]

object (Dimension)

The dimensions requested and displayed.

metrics[]

object (Metric)

The metrics requested and displayed.

limit

string (int64 format)

The number of rows to return. If the limit parameter is unspecified, 10,000 rows are returned. The API returns a maximum of 100,000 rows per request, no matter how many you ask for.

dimensionFilter

object (FilterExpression)

The filter clause of dimensions. Dimensions must be requested to be used in this filter. Metrics cannot be used in this filter.

metricFilter

object (FilterExpression)

The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. Metrics must be requested to be used in this filter. Dimensions cannot be used in this filter.

metricAggregations[]

enum (MetricAggregation)

Aggregation of metrics. Aggregated metric values will be shown in rows where the dimensionValues are set to "RESERVED_(MetricAggregation)".

orderBys[]

object (OrderBy)

Specifies how rows are ordered in the response.

returnPropertyQuota

boolean

Toggles whether to return the current state of this Analytics Property's Realtime quota. Quota is returned in PropertyQuota.

Response body

If successful, the response body contains data with the following structure:

The response realtime report table corresponding to a request.

JSON representation
{
  "dimensionHeaders": [
    {
      object (DimensionHeader)
    }
  ],
  "metricHeaders": [
    {
      object (MetricHeader)
    }
  ],
  "rows": [
    {
      object (Row)
    }
  ],
  "totals": [
    {
      object (Row)
    }
  ],
  "maximums": [
    {
      object (Row)
    }
  ],
  "minimums": [
    {
      object (Row)
    }
  ],
  "rowCount": integer,
  "propertyQuota": {
    object (PropertyQuota)
  }
}
Fields
dimensionHeaders[]

object (DimensionHeader)

Describes dimension columns. The number of DimensionHeaders and ordering of DimensionHeaders matches the dimensions present in rows.

metricHeaders[]

object (MetricHeader)

Describes metric columns. The number of MetricHeaders and ordering of MetricHeaders matches the metrics present in rows.

rows[]

object (Row)

Rows of dimension value combinations and metric values in the report.

totals[]

object (Row)

If requested, the totaled values of metrics.

maximums[]

object (Row)

If requested, the maximum values of metrics.

minimums[]

object (Row)

If requested, the minimum values of metrics.

rowCount

integer

The total number of rows in the query result, regardless of the number of rows returned in the response. For example if a query returns 175 rows and includes limit = 50 in the API request, the response will contain rowCount = 175 but only 50 rows.

propertyQuota

object (PropertyQuota)

This Analytics Property's Realtime quota state including this request.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/analytics.readonly
  • https://www.googleapis.com/auth/analytics