Skip to main content
View as Markdown

Custom Event Context - Analytics

Custom Event Context​

Per-Application Segmentation via appId​

Use the appId KS privilege to segment analytics by application:

# Generate KS with appId privilege
KS=$(curl -s -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:corporate-portal" | tr -d '"')

# All events sent with this KS are tagged under "corporate-portal"
curl -s -X POST "$KALTURA_SERVICE_URL/service/stats/action/collect" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "event[objectType]=KalturaStatsEvent" \
-d "event[partnerId]=$KALTURA_PARTNER_ID" \
-d "event[entryId]=$KALTURA_ENTRY_ID" \
-d "event[eventType]=3" \
-d "event[sessionId]=$SESSION_ID" \
-d "event[eventTimestamp]=$(date +%s)"

Pull per-application analytics via report.getTable with the same appId-scoped KS.

Event Context Fields​

FieldSourceDescription
userIdKS privilegeTies events to a specific user
appIdKS privilegeTags events to a named application
referrerEvent fieldPage URL or device identifier
clientVerEvent fieldClient application version
uiconfIdEvent fieldPlayer configuration ID