Event model
Tiny normalizes browser activity into a small event model designed for source setup, live verification, and session inspection.
Event types
Tiny accepts three event types:
- Name
page- Description
Used for pageviews. Tiny normalizes the event name to
page_view.
- Name
track- Description
Used for custom business or interaction events. The event name comes from the
namefield you send.
- Name
identify- Description
Used to associate future events with a user. Tiny normalizes the event name to
identify.
Shared fields
Every normalized event carries the same identity and timing fields.
- Name
id- Type
- string
- Description
Client-generated event identifier.
- Name
type- Type
- 'page' | 'track' | 'identify'
- Description
The normalized event type.
- Name
name- Type
- string
- Description
Event name after normalization.
- Name
timestamp- Type
- string
- Description
ISO timestamp for when the event occurred.
- Name
anonymousId- Type
- string
- Description
Stable anonymous visitor identifier generated by the Tiny runtime.
- Name
userId- Type
- string | null
- Description
Optional identified user.
- Name
sessionId- Type
- string
- Description
Session created during bootstrap and reused across later event requests.
Page object
Page data is stored separately from custom properties.
- Name
page.url- Type
- string | null
- Description
Full URL when available.
- Name
page.path- Type
- string | null
- Description
Path plus search string.
- Name
page.title- Type
- string | null
- Description
Document title or page override.
- Name
page.referrer- Type
- string | null
- Description
Browser referrer when available.
For page events, a page payload is required. For track and identify, page data is optional but still supported.
Context fields
Tiny stores custom event properties and shared context separately.
- Name
properties- Type
- object
- Description
Event-specific fields such as button labels, destinations, plan names, or report types.
- Name
context.locale- Type
- string | null
- Description
Browser locale when available.
- Name
context.timezone- Type
- string | null
- Description
Browser timezone when available.
- Name
context.userAgent- Type
- string
- Description
Browser user agent string.
- Name
context.screen- Type
- object | null
- Description
Optional screen width and height.
- Name
context.orgId- Type
- string | null
- Description
Optional organization identifier supplied by the app.
- Name
context.library- Type
- object
- Description
SDK metadata, currently
{ name: "@tiny/analytics", version }.
Example payload
{
"id": "evt_123",
"type": "track",
"name": "report_generated",
"timestamp": "2026-04-10T13:45:00.000Z",
"anonymousId": "vis_abc123",
"userId": "user_42",
"sessionId": "sess_789",
"page": {
"url": "https://app.example.com/reports/weekly",
"path": "/reports/weekly",
"title": "Weekly report",
"referrer": "https://app.example.com/dashboard"
},
"properties": {
"reportType": "weekly",
"source": "sidebar"
},
"context": {
"locale": "en-GB",
"timezone": "Europe/London",
"userAgent": "Mozilla/5.0 ...",
"screen": {
"width": 1440,
"height": 900
},
"orgId": "org_123",
"library": {
"name": "@tiny/analytics",
"version": "0.2.0"
}
}
}
Reserved identifiers, page data, and shared context should stay outside properties.