\n\n```\n\n### 2. Identify the person once they sign in\nTies the anonymous session to a real identity. Use their **email** as the id — Banchurn merges\npre-signup page views into it.\n\n```js\nwindow.banchurn.identify('user@example.com', { name: 'Jane Doe', plan: 'pro' });\n```\n\n### 3. Track the moments that matter\n```js\nwindow.banchurn.track('upgraded_plan', { from: 'free', to: 'pro', mrr: 49 });\n```\n\n### Verify it landed\nOpen **Dashboard → Live / Events** (rows appear within a second or two), or hit the endpoint directly:\n\n```bash\ncurl -s -X POST \"https://api.banchurn.com/api/track\" \\\n -H \"content-type: application/json\" \\\n -H \"x-api-key: YOUR_INGESTION_KEY\" \\\n -d '{\"eventName\":\"Signed Up\",\"visitorId\":\"test@example.com\",\"properties\":{\"plan\":\"free\"}}'\n```\n\nNothing showing up? Check the key is an **ingestion** key, the `host` has no trailing slash,\nand that `banchurn-analytics.js` actually loaded (Network tab, not ad-blocked).\n\nNext: the [JavaScript SDK](#tag/javascript-sdk) in depth, or [Server-side events and identity](#tag/server-side-events-and-identity) for events you must be able to trust." }, { "name": "JavaScript SDK", "description": "The drop-in auto-tracker (`banchurn-analytics.js`) is the fastest way to instrument any web app.\nConfigure it **before** it loads, and it handles the rest.\n\n### What it captures automatically\n- Page views and route changes\n- Clicks and form submissions\n- Session boundaries (and optional session recording)\n- Anonymous → known identity resolution\n\n### Configuration\n`window.BanchurnConfig` must be set on the page before the script tag runs.\n\n```html\n\n\n```\n\n### Identify\nCall as soon as you know who the visitor is. The id should be their **email** so anonymous\nsessions merge into the known person.\n\n```js\nwindow.banchurn.identify('user@example.com', { name: 'Jane Doe', plan: 'pro' });\n```\n\n### Track a custom event\n```js\nwindow.banchurn.track('upgraded_plan', { from: 'free', to: 'pro', mrr: 49 });\n```\n\n### React / Next.js\nPut the two script tags in your root shell (`app/layout.tsx` or `index.html`) using `next/script`,\nand set `BanchurnConfig` with `strategy=\"beforeInteractive\"`:\n\n```tsx\nimport Script from \"next/script\";\n\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n const key = process.env.NEXT_PUBLIC_BANCHURN_KEY;\n const host = process.env.NEXT_PUBLIC_BANCHURN_HOST ?? \"https://api.banchurn.com\";\n return (\n \n \n {children}\n \n