Overview - Analytics
Events Collection Overview
Report playback and engagement events back to Kaltura's analytics system. The standard Kaltura Player v7 handles event collection automatically via its built-in analytics plugin — this guide is for custom players, server-side tracking, and application-level instrumentation.
Base URL: https://www.kaltura.com/api_v3 (stats.collect), analytics server (trackEvent)
Auth: KS passed as ks parameter in POST form data
Format: Form-encoded POST, format=1 for JSON responses
Services covered:
| Service | Description |
|---|---|
stats.collect | Server-side event collection (API v3) |
analytics.trackEvent | Application-level event tracking (separate analytics server) |
| Player Analytics Plugin | Built-in event reporting in Kaltura Player v7 (reference implementation) |
When to Use
- Custom player developers reporting playback events from non-Kaltura players to feed Kaltura analytics
- Application teams tracking viewer behavior, page interactions, and CTA clicks alongside video events
- BI integration projects instrumenting server-side or client-side event collection for external analytics pipelines
- Mobile and OTT app builders implementing analytics parity with the Kaltura Player v7 built-in plugin
- Marketing and product teams segmenting analytics by application, user cohort, or custom context fields
Prerequisites
- KS type: USER KS (type=0) or ADMIN KS (type=2) with a
userIdset for per-user attribution - Plugins: No additional plugins required; the Kaltura Player v7 handles event collection automatically
- Session guide: Generate a KS using
session.startorappToken.startSession(see Session Guide)
Authentication
Event collection endpoints accept a KS for user attribution. Include userId in the KS to tie events to a specific user. Use the appId KS privilege for per-application segmentation.
export KALTURA_SERVICE_URL="https://www.kaltura.com/api_v3"
export KALTURA_KS="your_kaltura_session"
export KALTURA_PARTNER_ID="your_partner_id"
For analytics.trackEvent, the analytics server has a separate base URL:
export KALTURA_ANALYTICS_URL="https://analytics.kaltura.com"
Generate a KS with userId via session.start (see Session Guide):
curl -X POST "$KALTURA_SERVICE_URL/service/session/action/start" \
-d "secret=$KALTURA_ADMIN_SECRET" \
-d "format=1" \
-d "type=0" \
-d "partnerId=$KALTURA_PARTNER_ID" \
-d "userId=viewer@example.com" \
-d "privileges=appId:my-custom-player"
The appId:<name> privilege tags all analytics from this session under a named application, enabling per-application analytics segmentation.