The InkryptVideos SDK automatically tracks playback analytics and reports them to the InkryptVideos analytics backend. This guide explains what is tracked, how the system works, and how to correlate SDK analytics with your own data.
Overview
Analytics collection is automatic and enabled by default - no configuration is required to activate it. The SDK tracks playback events continuously during a session and sends them to the InkryptVideos analytics service in near real-time.
What is Tracked
Playback Events
The SDK tracks 11 event types across the video lifecycle:
| Event | When It Fires |
|---|---|
setup | Player begins initializing |
startup | First frame of video is rendered |
playing | Video is actively playing (sent periodically during playback) |
play | Playback resumes after a pause or seek |
pause | Playback is paused |
seeking | User initiates a seek operation |
bufferingStart | Playback stalls waiting for data |
bufferingEnd | Buffering completes and playback resumes |
qualityChange | The active quality level changes |
ended | Video plays to completion |
close | Player is reset or destroyed |
Per-Event Data
Every event payload includes the following fields:
| Field | Type | Description |
|---|---|---|
sessionId | String | Unique UUID for this player instance |
userId | String | Persistent device-specific UUID |
videoId | String | The video being played |
videoTimeStart | Int | Playback position at event start (seconds) |
videoTimeEnd | Int | Playback position at event end (seconds) |
videoDuration | Int | Total video duration (seconds) |
videoBitrate | Int | Active bitrate at the time of the event (bps) |
videoPlaybackWidth | Int | Video resolution width (pixels) |
videoPlaybackHeight | Int | Video resolution height (pixels) |
deviceType | String | "mobile" or "tablet" |
screenWidth | Int | Device screen width |
screenHeight | Int | Device screen height |
sequenceNumber | Int | Incrementing counter per session (for ordering events) |
dateTime | Date | Timestamp of the event |
m3u8Url | String? | HLS manifest URL |
analyticsVersion | String? | SDK analytics library version |
Session and User Identifiers
Session ID
A new session ID is generated each time a new player instance is created. It resets when params.update(...) is called (which creates a new player internally).
The sessionId is tracked internally and is not part of the public API. It appears in the InkryptVideos analytics dashboard and can be used there to look up full event logs for a specific playback session.
User ID
The user ID is a device-specific UUID generated automatically on first app launch and persisted in UserDefaults. It is stable across app launches and player instances.
// Static property — same value regardless of which InkPlayer instance
let userId: String? = InkPlayer.userId
Use userId to track viewing behavior for the same device across multiple sessions.
Privacy Note: By default,
userIdis a randomly generated UUID with no link to the user's real identity. It is used solely for anonymous analytics aggregation.
SDK Version
let sdkVersion: String? = InkPlayer.sdkVersion
Useful for filtering analytics data by SDK version when debugging version-specific issues.
Correlating with Your Own Analytics
If your app has its own user tracking or analytics system, you can correlate events using the SDK identifiers:
InkryptVideoPlayerView(
params: params,
onPlayerStateReady: { state in
// Log the SDK session alongside your own user context
MyAnalytics.shared.track("video_session_started", properties: [
"inkrypt_user_id": InkPlayer.userId ?? "unknown",
"video_id": "YOUR_VIDEO_ID",
"your_user_id": currentUser.id,
"sdk_version": InkPlayer.sdkVersion ?? "unknown"
])
}
)
Analytics Data Flow
User plays video
│
▼
SDK captures playback event
(play, pause, seek, buffer, etc.)
│
▼
Event sent to analytics.inkrypt.org
│
▼
Data processed and aggregated
│
▼
Available in InkryptVideos Dashboard
Events are dispatched asynchronously and do not affect playback performance. No analytics data is cached on-device between sessions.
Viewing Analytics in the Dashboard
All tracked data is aggregated and available in the InkryptVideos Dashboard, where you can view:
- Total play count per video
- Total watch time and average watch duration
- Completion rate: what percentage of viewers finish the video
- Quality distribution: which quality levels were watched most
- Buffering events: frequency and duration
- Device breakdown: mobile vs. tablet
- Per-session event timeline: full event log for a specific session
Privacy Considerations
The SDK collects the following data:
| Data Point | Personally Identifiable? | Notes |
|---|---|---|
userId | No | Randomly generated UUID, no PII |
sessionId | No | Randomly generated per session |
| Playback metrics | No | Timing, bitrate, resolution — no content captured |
| Device type | No | "mobile" or "tablet" |
| Screen dimensions | No | Device screen width/height |
No audio or video content is ever transmitted. Analytics are purely behavioral metadata about the viewing session.
If you replace the default
userIdwith a real user identifier from your own system (e.g., an account ID), you must ensure this is disclosed in your app's privacy policy and complies with applicable regulations including GDPR, CCPA, and App Store privacy nutrition labels.