Skip to main content
Use track() to record an outcome with a known Bily name or your own non-empty event name.

Send an event

Track a known outcome

Track an application outcome

Use stable snake_case names for application events. You still get autocomplete for known Bily names.

Know what Bily adds

When the SDK prepares a browser event, it adds:
  • A Bily browser tracking ID when one is available.
  • An ISO timestamp when ts is not already a string.
  • A generated event ID when event_id is empty or absent.
  • The browser source for the event.
Provide event_id when the same outcome needs one identifier across systems.

Track before loading finishes

Call track() before init() or while Bily loads. The SDK keeps those calls in memory until loading succeeds. The queue holds 100 calls by default. Set a limit from 1 to 1,000 with init({ maxQueueSize }). When the queue is full, the SDK removes the oldest call before it adds the newest.

Handle errors without interrupting the app

  • An empty or whitespace-only event name is ignored.
  • A browser delivery failure does not throw from track().
  • With debug: true, Bily logs a warning for delivery failures without logging the payload.
  • During server rendering, track() is a no-op.

Let the browser script track page views

The browser script records the initial page and supported client-side navigation automatically. Do not add manual PageView calls for those navigations; use track() for business events.

Event names

Payload types