Skip to Content
DevelopersEventsEvent schema

Event schema

Every event sent to /v1/batch follows one of six schemas. All share a common base structure stamped by the SDK transport.

Common fields (all event types)

FieldTypeRequiredDescription
typestringYesOne of: track, identify, page, screen, group, alias
messageIdstringYesSDK-generated unique id (for dedup)
timestampISO 8601 stringYesWhen the event occurred (SDK clock)
anonymousIdstringYesSDK-generated anonymous id
userIdstringConditionalYour application user id. Set after identify.
sessionIdstringYesSDK-managed session id
contextobjectNoContextual metadata (see below).

Context object

FieldTypeDescription
context.ipstringClient IP address (stamped server-side)
context.user_agentstringBrowser/device user agent
context.localestringUser locale (e.g., en-IN)
context.page.urlstringCurrent page URL
context.page.referrerstringReferring URL
context.device.typestringmobile, desktop, tablet
context.campaign.sourcestringUTM source
context.campaign.mediumstringUTM medium
context.campaign.namestringUTM campaign name

The Web SDK populates context automatically. For server-side events, include the fields you have.

track

Track a custom event — something the user did.

{ "type": "track", "event": "order_completed", "messageId": "msg_01HXXXXX", "timestamp": "2026-05-27T10:30:00.000Z", "anonymousId": "anon_abc", "userId": "user_456", "sessionId": "sess_def", "properties": { "order_id": "ORD-123", "amount": 4999, "currency": "INR", "products": ["SKU-A", "SKU-B"] } }
FieldTypeRequiredDescription
eventstringYesEvent name (e.g., order_completed, product_viewed)
propertiesobjectNoArbitrary key-value pairs describing the event

identify

Identify a user and set their traits.

{ "type": "identify", "userId": "user_456", "anonymousId": "anon_abc", "messageId": "msg_01HXXXXX", "timestamp": "2026-05-27T10:30:00.000Z", "sessionId": "sess_def", "traits": { "name": "Priya Sharma", "email": "[email protected]", "plan": "pro", "company": "Acme Corp" } }
FieldTypeRequiredDescription
userIdstringYesYour application user id
traitsobjectNoContact properties to set (merge-on-write)

identify is classified as PASSIVE for HAU billing — it stitches identity, it isn’t a user action. See MAU classification.

page

Track a web page view.

{ "type": "page", "name": "Product Detail", "messageId": "msg_01HXXXXX", "timestamp": "2026-05-27T10:30:00.000Z", "anonymousId": "anon_abc", "userId": "user_456", "sessionId": "sess_def", "properties": { "product_id": "SKU-A", "category": "Electronics", "url": "https://store.example.com/p/SKU-A" } }
FieldTypeRequiredDescription
namestringNoPage name (e.g., “Home”, “Product Detail”)
propertiesobjectNoAdditional page properties

screen

Track a mobile / SPA screen view. Same shape as page, but emitted by mobile SDKs or by web SPAs for in-place step transitions (e.g., storefront.cart).

{ "type": "screen", "name": "storefront.cart", "messageId": "msg_01HXXXXX", "timestamp": "2026-05-27T10:30:00.000Z", "anonymousId": "anon_abc", "sessionId": "sess_def", "properties": { "step": "cart" } }

group

Associate a user with a company or account.

{ "type": "group", "userId": "user_456", "groupId": "company_789", "messageId": "msg_01HXXXXX", "timestamp": "2026-05-27T10:30:00.000Z", "anonymousId": "anon_abc", "sessionId": "sess_def", "traits": { "name": "Acme Corp", "industry": "Retail", "employees": 50 } }
FieldTypeRequiredDescription
groupIdstringYesThe group/company identifier
traitsobjectNoGroup properties

alias

Merge an anonymous session with an identified user.

{ "type": "alias", "userId": "user_456", "anonymousId": "anon_abc123", "messageId": "msg_01HXXXXX", "timestamp": "2026-05-27T10:30:00.000Z", "sessionId": "sess_def" }
FieldTypeRequiredDescription
userIdstringYesThe identified user id (destination)
anonymousIdstringYesThe anonymous id to merge (source)

After aliasing, events from anon_abc123 are attributed to user_456. alias is also classified as PASSIVE for HAU billing — it’s identity stitching, not a user action.

What’s next