Browser SDK

track

Record meaningful user behavior in the browser.

Signature#

  • eventName or event: required string.
  • properties: optional plain object describing behavior or outcome.
  • options: optional object containing userId, anonymousId, context, timestamp, integrations, messageId, or extra context fields.
  • callback: optional function receiving the dispatched context.

The object form is also supported. properties defaults to {}. A missing event name throws Event missing.

When to call#

Call track when a meaningful action occurs: a workflow step opens or completes, a feature is used, a payment is attempted, or an outcome occurs.

Do not call it for every click or keystroke unless opt-in instrumentation is intended. Do not send user-entered content.

Payment funnel#

Use a backend event for authoritative payment success when possible.

Options example#

Normalized payload#

Never include passwords, secrets, tokens, card data, raw form values, search queries, messages, or prompts.