Skip to main content
Browser conversion tracking is useful for actions known only to client code. Prefer server tracking when your backend can verify the result.

Track a lead

The SDK uses its stored click ID when clickId is omitted.

Track a sale

4999 means $49.99 USD. Amounts use integer minor units.

Handle queued results

Temporary network and server failures are placed in a bounded browser retry queue.
The default queue:
  • stores at most 100 events;
  • expires events after seven days;
  • stops after eight failed delivery attempts;
  • retries with bounded exponential backoff and jitter;
  • separates records by publishable key and API host.
Calling setConsent(false) clears the queue.

Keep identifiers stable

Create an identifier from the business event, not from the request attempt.
Do not use a fresh timestamp or random ID every time retry code runs. That would describe a new logical event.

Know the browser limitation

A browser event can be blocked by privacy software, lose connectivity, or disappear when storage is cleared. Do not use browser code as the only authority for paid orders, refunds, renewals, or other financial state. For trusted events, forward bq_id to your backend and use the server quickstart.