A project's live streams over a WebSocket
GET/ v1/ live/ projects/ {project}
Needs analytics.view and the session cookie; the browser's origin must be the dashboard. Streams: realtime, feed (the last 50 page views and events, newest first; engagement pings left out) and debugger (the last 100, with properties and warnings, test-key events included and marked test). realtime and feed include events accepted a moment ago that are not in the reports yet, so a page view shows within 2 seconds; the socket pushes at once when events arrive (at most every half second), and every 2 seconds otherwise. Errors before the upgrade: not_found (404). A failing push closes the socket with 1011 internal_error; the client reconnects.
Path parameters
project
The project's id (
prj_…).Responses
Switched to the WebSocket protocol.
LiveMessage
One push from the server.
Show 3 fieldsHide fields
stream: realtime
Show 2 fieldsHide fields
stream
realtimedata
Show 5 fieldsHide fields
online_now
Visitors with any event in the last 5 minutes.
visitors_per_minute
The last 30 minutes; minutes without visitors are left out.
Show 2 fieldsHide fields
minute
A time in UTC, ISO 8601.
visitors
pages
The top 10 pages of the last 5 minutes.
Show 2 fieldsHide fields
value
visitors
countries
The top 50 countries of the last 5 minutes.
Show 2 fieldsHide fields
value
visitors
at
A time in UTC, ISO 8601.
stream: feed
Show 2 fieldsHide fields
stream
feeddata
One event of the
feed stream, without its properties.Show 9 fieldsHide fields
id
type
pagevieweventengagementname
timestamp
A time in UTC, ISO 8601.
page
source
country
city
device_type
stream: debugger
Show 2 fieldsHide fields
stream
debuggerdata
One event of the debugger (query.Recent's columns).
Show 15 fieldsHide fields
id
type
pagevieweventengagementname
The custom event's name; empty for page views.
timestamp
A time in UTC, ISO 8601.
hostname
page
source
country
city
device_type
browser
os
properties
warnings
test
True for an event sent with a test key. Test events show only here, never in reports, Realtime or exports.
LiveSubscribe
Sent by the client to choose its streams.
Show 2 fieldsHide fields
type
subscribestreams
realtimefeeddebuggerExample response
1{2"stream": "realtime",3"data": {4"online_now": 1,5"visitors_per_minute": [6{7"minute": "2026-11-21T09:30:00Z",8"visitors": 1.59}10],11"pages": [12{13"value": "string",14"visitors": 1.515}16],17"countries": [18{19"value": "string",20"visitors": 1.521}22],23"at": "2026-11-21T09:30:00Z"24}25}