How to migrate from Google Analytics to Plausible Analytics
Unlike most analytics migrations, there's a real way to import history here — but it only covers aggregate metrics (visits, pages, sources), not session-level detail or Google Signals demographic profiles.
- 1
First: enable the Google Analytics Data API
In Google Cloud Console, on the project linked to your Google Analytics (GA4) property, enable the "Google Analytics Data API" — this is a prerequisite for Plausible Analytics to be able to read your history; without it, the import fails silently during authorization.
- 2
Deploy Plausible Analytics via Docker Compose
Plausible Analytics needs PostgreSQL and ClickHouse (see the docker-compose.yml on its page) — ClickHouse is the real engine where events get aggregated, not a cosmetic option. Set BASE_URL to your final domain first, before generating any tracking script.
- 3
Replace Google Analytics's snippet with Plausible Analytics's
Replace Google Analytics's gtag.js/analytics.js with Plausible Analytics's script (`<script defer data-domain="yourdomain.com" src="https://analytics.yourdomain.com/js/script.js"></script>`). Keep both scripts running in parallel for 2-3 weeks to compare traffic numbers before relying solely on Plausible Analytics.
- 4
Import history via the Google Analytics Data API
In Plausible Analytics, go to Site Settings → Import & Export → Import from Google Analytics, authorize OAuth access to the correct GA4 property, and pick the date range. The import brings in visits, top pages, and aggregate traffic sources — it doesn't bring custom events or individual-user-level data.
- 5
Rewrite custom events by hand
Every `gtag('event', ...)` call from Google Analytics in your code needs to be rewritten as Plausible Analytics's `plausible('EventName', {props: {...}})` — there's no automatic conversion. Find every custom event you use (conversions, CTA clicks) and add the equivalent call before fully retiring Google Analytics.
Before cancelling Google Analytics
Before cancelling Google Analytics, also export the audience/demographic reports (Google Signals) you use for internal reporting — Plausible Analytics doesn't offer that kind of profiling by design (it's part of why it's more private), so that data has no equivalent and disappears once you close the account.
Ready to deploy Plausible Analytics?
Full profile with license, tech stack and ready-to-copy docker-compose.
View Plausible Analytics's profileThese steps are a general guideline — the exact export menu can vary depending on Google Analytics's plan and version.