Documentation
Add the script to your site's <head>. Page views, referrers and Web Vitals start arriving straight away. For apps and servers, pick an SDK below.
index.html
<script defer data-site="SITE_ID" src="https://stancelens.com/e.js"></script>Replace SITE_ID with your site ID. Getting started
Get started
Web
- Tracker modulesThe core script, the opt-in modules you turn on with one attribute, and every option.
- JavaScript SDK@stancelens/js: one client for browsers, Node and edge runtimes, with batching, retries and an offline queue.
- React@stancelens/react: a provider, hooks for tracking and feature flags, and page views for any router.
- Next.js@stancelens/next: App Router page views and hooks, a script-tag alternative, and server-side tracking.
- Proxying the scriptServe the tracker from your own domain for complete, first-party data.
- Excluding trafficKeep your own visits, internal pages and bots out of your stats.
- Site settingsEvery tab under Site settings, what it changes and who can change it.
Mobile
- Mobile appsHow sessions, screens, offline delivery, app versions and privacy work when you track a native or cross-platform app.
- React NativeScreens, events, identify, revenue, flags and an offline queue for React Native apps.
- ExpoUse the React Native SDK in Expo apps, with Expo Router screen tracking.
- FlutterEvents, screens, sessions, revenue, feature flags and errors for Flutter apps on Android, iOS, the web and desktop.
- iOS (Swift)Swift package for iOS, iPadOS, macOS, tvOS, watchOS and visionOS, in SwiftUI or UIKit.
- Android (Kotlin)Kotlin library for Android apps, with Jetpack Compose helpers. minSdk 21.
Server
Tools
API
Guides
- Custom eventsTrack clicks, sign-ups, form submissions and anything else with one function call.
- Identify usersConnect anonymous visits to logged-in users for profiles, retention and journeys.
- Revenue trackingSend revenue from your site or app, or connect Stripe, RevenueCat, Paddle, Lemon Squeezy, Polar, Paystack, PayFast, Flutterwave, Razorpay, Mollie, Gumroad, the App Store or Google Play.
- Goals & funnelsDefine conversions and measure step-by-step drop-off.
- Saved views and boardsSave a period and filters as a view you can apply on any page, and build boards of the tiles you check most.
- Feature flags & experimentsRoll out features gradually and A/B test them with built-in statistics.
- Session replayWatch privacy-safe recordings of real visits to understand friction.
- HeatmapsClick heatmaps, rage and dead clicks, and scroll maps per page and screen size, without recording what people type or read.
- Web vitals & errorsReal-user Core Web Vitals and JavaScript error tracking, with two opt-in modules.
- Public dashboardsShare a read-only, live dashboard with anyone who has the link.
- Privacy & GDPRHow Stancelens counts visitors without cookies, and what that means for compliance.
- Import dataBring your history from Plausible, Google Analytics 4, Umami, Fathom, Simple Analytics, Mixpanel, PostHog or any CSV or NDJSON file.
- Migrating to StancelensImport your traffic history, swap the script and map your event calls.