SDK reference
Every public method on the analytics global, plus the data-track attribute.
The browser SDK is loaded by the install snippet. It exposes a single global, window.analytics, with three methods. The API is frozen — we won't add, remove, or rename methods in V1.
analytics.pageview()
Manually fire a pageview. The SDK calls this automatically on page load and on history.pushState / popstate, so single-page apps don't need to call it. Only call it manually if you're using a router that the SDK can't hook into.
window.analytics.pageview()analytics.success(name, properties?)
Fire a success event. The name is the rule name you registered in the dashboard. properties is an optional flat object of string/number/boolean values.
window.analytics.success('paid-customer', {
plan: 'starter',
value: 9.99,
})PII safety
Any property key matching email, phone, password, or ssn (case-insensitive) is stripped server-side before the event is written. You can't accidentally leak PII even if you forget.
Server clock
The timestamp on the row is set by the server, not the browser. Your client's clock skew, timezone, and time-tampering don't affect data quality.
analytics.identify(userId)
Associate the current visitor with a stable user identifier for v1.1's cross-session journey attribution. Today this just tags the next events with success_user_id. Behavior won't change.
window.analytics.identify('user_42')data-track="..." attribute
Add data-track to any clickable element. The SDK auto-attaches a delegated click listener that fires a click event with the attribute value as name.
<button data-track="signup-cta">Get started</button>
<a data-track="pricing-nav" href="/pricing">Pricing</a>The click row is independent of any success rule. Register a click rule in the dashboard to synthesize a success event when the click happens.
SDK options
There are no SDK options for V1. Everything you'd configure (success rules, sites, API keys) is configured server-side in the dashboard.
Bundle size
The SDK is 3 KB gzipped. There's a CI budget that fails the build at 3.5 KB.
What's next
- For backend-confirmed conversions: Server events.
- For ad-blocker resilience: First-party proxy setup.
- For a security review + CSP directives: Security & CSP.