Install
Create your account, add your domain, then pick your stack. Your site ID is in Settings; with the package it's not needed (we match your domain).
Next.js
app/layout.tsx
React (Vite, CRA)
index.html · in <head>
Remix / React Router
app/root.tsx · in <head>
Vue / Nuxt
nuxt.config.ts (Vue: index.html <head>)
Script options
| Attribute | What it does |
|---|---|
data-site | Your site ID. Optional when the domain matches the one you added. |
data-api | Send events to another endpoint (used with a proxy, see below). |
data-allow-localhost | Count visits on localhost (off by default). |
data-global | Rename window.obsidesk if the name is taken. |
Exclude your own visits: open https://yoursite.com/#obsidesk-ignore once per browser. Undo with #obsidesk-track.
Custom events
No code: add data-obsidesk-event="Pricing CTA" to any link or button. Properties accept strings, numbers and booleans (40-character keys, 200-character values). Outbound link clicks and form submissions are tracked automatically.
Signups & identify
Any submitted form with an email field identifies the visitor automatically. Password and payment fields are never read. Add data-obsidesk-ignore to a form to skip it. To identify explicitly (for example after OAuth sign-in):
Revenue attribution
Stripe Payment Links: nothing to do. The script adds the visitor ID as client_reference_id on every buy.stripe.com link.
Stripe Checkout from your server: pass the visitor ID from the browser.
Whop: add obsidesk_visitor to the checkout metadata, or rely on email matching from your signup form.
Attribution is first-touch: a payment is credited to the channel, referrer, campaign and landing page of the buyer's first recorded visit. Payments we can't match appear as unattributed.
Connect Stripe
Dashboard → Settings → Revenue. Create a restricted key in Stripe (Developers → API keys → Create restricted key) with Read on: Charges, Customers, Disputes, Subscriptions, Checkout Sessions, Invoices, Balance transactions, Products, Prices. Everything else stays on None. Paste the rk_live_… key. It's encrypted at rest with AES-256-GCM and never displayed again. History imports in seconds to a few minutes, then syncs hourly.
Connect Whop
Whop → Settings → Developer → create a company API key. Paste it with your company ID (biz_…). Payments, memberships, refunds and renewals sync hourly.
Proxy through your own domain
Some ad blockers block third-party analytics. Serving the script from your own domain keeps your numbers complete. With Next.js:
What we collect
- Page path, title, referrer, UTM parameters, screen width, language, timezone.
- Country, region and city derived from the request at the edge. IP addresses are never stored.
- A random visitor ID in local storage (no cookies) and a 30-minute session ID.
- Email and name only when a visitor submits a form with an email field or you call
identify. - Never: passwords, payment card data, form contents other than email and name, keystrokes or session recordings.