---
title: Overview
url: https://docs.kaltura.com/docs/rich-media-cms-apis/analytics/analytics-events-overview
---

## 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 `userId` set for per-user attribution  
- **Plugins:** No additional plugins required; the Kaltura Player v7 handles event collection automatically  
- **Session guide:** Generate a KS using `session.start` or `appToken.startSession` (see [Session Guide](/docs/getting-started/authentication/ks-overview))

### 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.

```bash
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:

```bash
export KALTURA_ANALYTICS_URL="https://analytics.kaltura.com"
```

Generate a KS with `userId` via `session.start` (see [Session Guide](/docs/getting-started/authentication/ks-overview)):

```bash
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.
