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).
For a guide to constructing realtime requests & understanding responses, see Creating a Realtime Report.
HTTP request
POST https://analyticsdata.googleapis.com/v1beta/{property=properties/*}:runRealtimeReport
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
property |
A Google Analytics 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 ( |
Fields | |
---|---|
dimensions[] |
The dimensions requested and displayed. |
metrics[] |
The metrics requested and displayed. |
dimension |
The filter clause of dimensions. Metrics cannot be used in this filter. |
metric |
The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. Dimensions cannot be used in this filter. |
limit |
The number of rows to return. If unspecified, 10,000 rows are returned. The API returns a maximum of 250,000 rows per request, no matter how many you ask for. The API can also return fewer rows than the requested |
metric |
Aggregation of metrics. Aggregated metric values will be shown in rows where the dimensionValues are set to "RESERVED_(MetricAggregation)". |
order |
Specifies how rows are ordered in the response. |
return |
Toggles whether to return the current state of this Google Analytics property's Realtime quota. Quota is returned in PropertyQuota. |
minute |
The minute ranges of event data to read. If unspecified, one minute range for the last 30 minutes will be used. If multiple minute ranges are requested, each response row will contain a zero based minute range index. If two minute ranges overlap, the event data for the overlapping minutes is included in the response rows for both minute ranges. |
Response body
The response realtime report table corresponding to a request.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{ "dimensionHeaders": [ { object ( |
Fields | |
---|---|
dimension |
Describes dimension columns. The number of DimensionHeaders and ordering of DimensionHeaders matches the dimensions present in rows. |
metric |
Describes metric columns. The number of MetricHeaders and ordering of MetricHeaders matches the metrics present in rows. |
rows[] |
Rows of dimension value combinations and metric values in the report. |
totals[] |
If requested, the totaled values of metrics. |
maximums[] |
If requested, the maximum values of metrics. |
minimums[] |
If requested, the minimum values of metrics. |
row |
The total number of rows in the query result. |
property |
This Google Analytics property's Realtime quota state including this request. |
kind |
Identifies what kind of resource this message is. This |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/analytics.readonly
https://www.googleapis.com/auth/analytics
MinuteRange
A contiguous set of minutes: startMinutesAgo
, startMinutesAgo + 1
, ..., endMinutesAgo
. Requests are allowed up to 2 minute ranges.
JSON representation |
---|
{ "name": string, "startMinutesAgo": integer, "endMinutesAgo": integer } |
Fields | |
---|---|
name |
Assigns a name to this minute range. The dimension |
start |
The inclusive start minute for the query as a number of minutes before now. For example, If unspecified, |
end |
The inclusive end minute for the query as a number of minutes before now. Cannot be before If unspecified, |