Quick start
Track an event in under a minute.
The Event Tracking API ingests event beacons from your application, validates each payload against the event types reference, enriches it with server-side context, and publishes it for processing.
Prefer the SDK
Most applications should integrate through the Croct SDK, which handles authentication, client IDs, context detection, and beacon delivery. Call the HTTP API directly only for custom integrations or when building a new client.
Track an event
Make a POST request to /client/web/track with the event envelope:
JavaScript
1234567891011121314151617
const response = await fetch('https://api.croct.io/client/web/track', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-App-Id': '<APP ID>', 'X-Client-Id': '<CLIENT ID>', }, body: JSON.stringify({ originalTime: Date.now(), departureTime: Date.now(), context: {url: 'https://example.com/home'}, payload: { type: 'pageOpened', url: 'https://example.com/home', }, }),});A successful request returns 204 No Content with an empty body.
See the endpoint reference for more details.