Getting started
Add Stancelens to your site in under two minutes and see your first visitors live.
Stancelens is privacy-first web and product analytics: traffic, funnels, retention, revenue, replays, flags and experiments in one dashboard. The web tracker sets no cookies, so in most setups you don't need a consent banner.
1. Create a site
Sign up with email and password, a magic link, Google or GitHub (more), choose a plan and add your domain. The site gets a site ID derived from the domain (example.com becomes example-com). It identifies the site in the tracking script, the SDKs and the API, and you'll find it under Site settings → Tracking code.
2. Add the script
Paste this into the <head> of every page. Replace SITE_ID with your site ID.
<script defer data-site="SITE_ID" src="https://stancelens.com/e.js"></script>Using a framework? See Install the script for Next.js, React, Vue, Nuxt, SvelteKit, WordPress, Shopify, Webflow and Google Tag Manager. Building a mobile app or sending events from a server? Start with Mobile apps or the REST API.
3. Verify it works
- Open your site in a new tab.
- Open the Realtime view in your Stancelens dashboard. Your visit should appear within a few seconds.
- Not showing up? Visits from
localhostare ignored twice: by the script unless you adddata-allow-localhost, and by the server while Ignore localhost is on under Site settings → Exclusions (details). Check that ad blockers are off for the test, or proxy the script through your own domain.
4. Track what matters
Page views, referrers, UTM campaigns, devices and countries are collected automatically. Tracker modules add outbound links, file downloads, scroll depth, Web Vitals and JavaScript errors. Next, add the events that matter to your business:
// Anywhere in your app
stancelens("event", "signup", { plan: "pro" });- Custom events: buttons, forms and anything else.
- Identify users: tie activity to logged-in accounts.
- Revenue tracking: see which channels drive paying customers.
- Goals & funnels: measure conversion step by step.
What the script collects
| Data | Collected | Notes |
|---|---|---|
| Page path, referrer, UTM tags | Yes | The stored path has no query string; UTM tags (and ref, source, via) are kept as campaign fields |
| Browser, OS, device type | Yes | Parsed from the user agent; the full user-agent string isn't stored |
| Country, region, city | Yes | From the geo headers of the CDN in front of Stancelens (Cloudflare, Vercel, CloudFront and others). Without them only the country is estimated, from the time zone an SDK sends or else the browser language (en-GB gives GB) |
| IP address | No | Used in memory to compute a visitor hash with a salt that rotates daily; never written to disk |
| Cookies | No | The tracker sets none. It uses localStorage only for the user ID you pass to identify and the stancelens_ignore flag you set yourself |