Skip to main content
POST
cURL

Overview

Send a custom event for an action you want to track, such as starting a trial or inviting a teammate. Give the event a consistent name and include properties that explain what happened.

Examples

Set UNIFY_WRITE_KEY to the event source’s write key and use an allowed origin in the Origin header. Replace the example visitor ID and timestamp with those from the actual event. See Analytics authentication for setup.
Use the same visitorId as the visitor’s page and identify events. Custom event names and properties can then inform your event filters.

Authorizations

X-Write-Key
string
header
required

Use the event source’s write key. Requests also require an allowed Origin header.

Headers

Origin
string<uri>
required

Website or application origin allowed for the event source. Required for browser and server-side requests.

Body

application/json

A track event represents a custom action or activity performed by a visitor.

type
enum<string>
required

The type of analytics event being sent.

Available options:
track
visitorId
string
required

Unique identifier for the visitor that triggered this event.

timestamp
string<date-time>
required

Timestamp of the event (in UTC).

context
object
required

Contextual information about the client behind the event.

name
string
required

Name of the event that was tracked.

sessionId
string

Unique identifier for the session in which this event occurred.

sentAt
string<date-time>

Timestamp at which the request was sent (in UTC). May differ from the event timestamp if sending was delayed.

properties
object

Details about the event that was tracked.

Response

The request has succeeded.