Skip to main content
Livestream analytics track a viewer’s watch session for a room. The social.plus SDK owns session creation, local watch-session storage, duration updates, and pending-session sync. Your app owns deciding when a viewer is actually watching, when playback is paused or buffering, and when a viewer changes role from viewer to host or co-host.
This page covers SDK room watch-session APIs. Product analytics dashboards, custom event names, media player state, and business reporting are app-owned concerns after you create and update watch sessions.

Platform Surface

Parameters

Create a Watch Session

Create a watch session when the current user starts viewing a room as a viewer. The SDK accepts watch sessions only for rooms in watchable states: live or recorded.

Update Watch Duration

Update the session with the accumulated watch duration in seconds. Count only time your player considers watchable, such as active playback, and exclude buffering, paused, or backgrounded states according to your product rules.

Sync Pending Sessions

Call sync when the viewer leaves the playback experience or changes out of a viewer role. The SDK sync method handles pending locally stored sessions; your app decides the lifecycle event that should trigger it.

Tracking Boundaries

Do not create watch sessions for idle, ended, terminated, or error rooms. Create sessions only after the room is live or recorded.

Error Handling

Live Room Viewing

Observe live room state before creating viewer sessions.

Recorded Playback

Track recorded room playback after recording metadata is available.

Co-Host Management

Stop viewer tracking when a viewer becomes a co-host.