OursPrivacy

Track Events

Track events from your server. Include at least one of userId, externalId, or email so the event can be associated with a visitor. Identity resolution runs in priority order: userId (direct, no lookup) → externalId (lookup by your ID) → email (fallback lookup). If you know both userId and externalId, send both. For top-level visitor properties: null clears the existing value, while undefined, omitted fields, and empty strings are ignored. For entries inside custom_properties: null, undefined, and empty strings are all ignored (custom_properties use merge semantics). See https://docs.oursprivacy.com/docs/data-types for details and common pitfalls.

post/track

Request body

eventstring required

The name of the event you're tracking. This must be whitelisted in the Ours dashboard.

tokenstring required

The token for your Source. You can find this in the dashboard.

userIdstring nullable

The Ours Visitor ID stored in local storage and cookies on your web properties. When present, this is used directly — no lookup by externalId or email is performed. If you have both a userId and an externalId, send both so the event is attached to the right visitor without any lookup overhead.

externalIdstring nullable

Your system's unique identifier for this user. We search your account for an existing visitor with this externalId and attach the event to them (resolving to their Ours Visitor ID). If no match is found, a new visitor is created. When present, email lookup is skipped. If you also have the userId from cookies or local storage, send both — it removes the lookup round-trip.

emailstring nullable

The email address of a user. Used as a fallback lookup when neither userId nor externalId is provided. We search your account for a visitor with this email and attach the event to them. If no match is found, a new visitor is created.

timenumber nullable

The time at which the event occurred in milliseconds since UTC epoch. The time must be in the past and within the last 7 days.

distinctIdstring nullable

A unique identifier for this event used for deduplication. Highly recommended — if omitted, Ours will generate one for you, but supplying your own gives you stronger idempotency guarantees (e.g. a Stripe payment intent ID or your internal order ID).

eventPropertiesobject nullable

Any additional event properties you want to pass along.

Response

Success - your event was sent to our servers

successtrue required

Changes

No recorded changes to this endpoint across all 1 revision of this API.