Migrating to Stancelens
Import your traffic history, swap the script and map your event calls.
Import history
Bring your history with you from Plausible, Google Analytics 4, Umami, Fathom, Simple Analytics, Mixpanel, PostHog or any CSV/NDJSON file under Site settings → Import data. Imports fill the days before you started tracking, so nothing is counted twice. See Import data for each tool's export steps.
Run the old tool and Stancelens side by side for a week. Expect a few percent difference: cookieless counting isn't blocked by consent, and bot filtering differs between tools.
From Google Analytics
- Replace the gtag.js snippet with the Stancelens script.
- Rename event calls as below. Purchase events with a
revenueproperty show up in Revenue. - Remove GA. Without other cookies on the site, you can usually drop the consent banner too.
gtag → stancelens
// Before
gtag("event", "sign_up", { method: "Google" });
gtag("event", "purchase", { value: 49, currency: "USD" });
// After
stancelens("event", "sign_up", { method: "Google" });
stancelens("event", "purchase", { revenue: 49, currency: "USD" });From Plausible
- Swap the script tag and rename custom event calls as below.
class="plausible-event-name=Signup"becomesdata-el-event="Signup".
plausible → stancelens
// Before
plausible("Signup", { props: { plan: "pro" }, revenue: { amount: 49, currency: "USD" } });
// After
stancelens("event", "Signup", { plan: "pro", revenue: 49, currency: "USD" });From PostHog
- Swap the SDK for the script tag and update calls as below.
- Recreate feature flags with the same keys so code changes stay small.
posthog → stancelens
// Before
posthog.capture("invite_sent", { seats: 3 });
posthog.identify("user_8231", { plan: "growth" });
if (posthog.isFeatureEnabled("new-checkout")) { /* … */ }
// After
stancelens("event", "invite_sent", { seats: 3 });
stancelens("identify", "user_8231", { plan: "growth" });
if (await stancelens.flag("new-checkout")) { /* … */ }From other tools
| Tool | Event call |
|---|---|
| Umami | umami.track(n, d) → stancelens('event', n, d) |
| Fathom | fathom.trackEvent(n) → stancelens('event', n) |
| Simple Analytics | sa_event(n) → stancelens('event', n) |
| Mixpanel | mixpanel.track(n, p) → stancelens('event', n, p) |