---
title: Server-Side Collection
url: https://docs.kaltura.com/docs/rich-media-cms-apis/analytics/analytics-events-server-side
---

## Server-Side Collection

For backend systems that play or process video without a browser.

### Use Cases

- **Kiosks and digital signage** — Display terminals playing video content
- **Set-top boxes** — OTT/IPTV devices
- **Batch processing** — Server-side video processing that should count in analytics
- **Mobile backends** — Server-side proxy for mobile app analytics

### Pattern

```bash
# Generate a KS with userId for per-user attribution
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=kiosk-001@example.com" | tr -d '"')

# Report playback events via stats.collect
SESSION_ID="kiosk_$(date +%s)"

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)" \
  -d "event[referrer]=kiosk://device-001"
```

Include device context in the `referrer` field for analytics segmentation.
