Getting started
Event schema
The complete JSON contract for every event Tapemetric accepts.
Full payload example
json
{
"event_type": "play_start",
"ts": "2026-04-23T18:30:12.456Z",
"anonymous_id": "a8f3c2d0-1e5b-4a9c-8d4e-7f2a1b3c4d5e",
"user_id": "user_12345",
"session_id": "sess_a1b2c3d4e5f6g7h8",
"content_id": "aashiqana_s04e12",
"content_type": "series",
"content_title": "Aashiqana · S4 E12",
"season": 4,
"episode": 12,
"position_sec": 0,
"duration_sec": 2640,
"bitrate_kbps": 4500,
"buffer_count": 0,
"buffer_duration_ms": 0,
"plan": "svod",
"revenue_inr": null,
"context": {
"device_type": "tv",
"os": "Tizen",
"browser": "Tizen Browser",
"app_version": "4.12.0",
"user_agent": "Mozilla/5.0 (SMART-TV; LINUX; Tizen 6.0) AppleWebKit/..."
},
"properties": {
"drm": "widevine",
"quality_preset": "auto"
}
}Required fields
| Field | Type | Notes |
|---|---|---|
event_type | string | Max 48 chars. See event types. |
ts | ISO 8601 UTC | Client clock — server re-times within ±30s tolerance. |
anonymous_id | string | UUID. Persisted by the SDK in localStorage. |
session_id | string | Rotates after 30 min of inactivity. |
Identity
| Field | Type | Notes |
|---|---|---|
user_id | string? | Set after identify(). Max 128 chars. |
Content
| Field | Type | Notes |
|---|---|---|
content_id | string? | Stable URL-safe slug. Max 128 chars. |
content_type | enum | series · film · live · short |
content_title | string? | Human-readable. Max 255 chars. |
season | int? | For series only. |
episode | int? | For series only. |
Playback
| Field | Type | Notes |
|---|---|---|
position_sec | float? | Current playhead position. |
duration_sec | float? | Total content length. |
bitrate_kbps | int? | Current ABR rung. |
buffer_count | int? | Number of rebuffers since play start. |
buffer_duration_ms | int? | Cumulative rebuffer time in ms. |
Monetization
| Field | Type | Notes |
|---|---|---|
plan | enum | svod · avod · tvod · free |
revenue_inr | float? | For purchase events. |
Context (auto-collected)
The SDK fills these automatically. Override them on server-to-server calls if needed.
| Field | Type | Notes |
|---|---|---|
context.device_type | enum | tv · mobile · web · tablet · stb |
context.os | string? | Parsed from user agent. |
context.browser | string? | Parsed from user agent. |
context.app_version | string? | Your app version. |
context.user_agent | string? | Full UA string. |
Free-form properties
Pass any custom JSON object in the properties field. Supported on every event type. Keys are lowercased and snake_cased server-side; nested objects are preserved but not indexed for querying.