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
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
tsis not already a string. - A generated event ID when
event_idis empty or absent. - The browser source for the event.
event_id when the same outcome needs one identifier across systems.
Track before loading finishes
Calltrack() 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.
Track only later page views
The firstPageView is automatic. Call track("PageView", ...) only after a later client-side route change.