How to Migrate from Google Analytics to Plausible
How to Migrate from Google Analytics to Plausible
Google Analytics collects massive amounts of user data, requires cookie consent banners, and the GA4 interface frustrates everyone. Plausible is a privacy-first alternative — no cookies, GDPR-compliant by default, and a dashboard you can actually read. Here's how to switch.
Why Switch?
- No cookie consent banners needed — Plausible doesn't use cookies
- GDPR/CCPA compliant by default — no personal data collection
- 1-line script vs GA4's complex setup
- Real-time dashboard that loads instantly
- < 1 KB script vs GA4's 45+ KB
- Self-hostable for full data ownership
Step 1: Set Up Plausible
Option A: Plausible Cloud ($9/month for 10K pageviews)
- Sign up at plausible.io
- Add your domain
- Get your tracking snippet
Option B: Self-hosted (free)
git clone https://github.com/plausible/community-edition.git
cd community-edition
cp .env.example .env
# Edit .env
# BASE_URL=https://analytics.yourdomain.com
# SECRET_KEY_BASE=$(openssl rand -base64 48)
docker compose up -d
Step 2: Add the Tracking Script
Replace the Google Analytics snippet with Plausible's single line:
Remove Google Analytics:
<!-- DELETE THIS -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXX');
</script>
Add Plausible:
<!-- ADD THIS (< 1 KB, no cookies) -->
<script defer data-domain="yourdomain.com" src="https://plausible.io/js/script.js"></script>
For self-hosted:
<script defer data-domain="yourdomain.com" src="https://analytics.yourdomain.com/js/script.js"></script>
Framework-specific:
// Next.js — app/layout.tsx
import Script from 'next/script';
export default function RootLayout({ children }) {
return (
<html>
<head>
<Script
defer
data-domain="yourdomain.com"
src="https://plausible.io/js/script.js"
/>
</head>
<body>{children}</body>
</html>
);
}
Step 3: Import Historical Data (Optional)
Plausible supports importing your Google Analytics history:
- Go to Plausible → Site Settings → Import Data
- Click Google Analytics
- Authorize the Google connection
- Select the GA property to import
- Import completes (may take hours for large datasets)
What imports: Pageviews, visitors, sources, countries, devices, pages. What doesn't: Events, user demographics, behavior flow.
Step 4: Set Up Goals and Events
GA4 events → Plausible goals:
<!-- Custom event tracking -->
<script>
// Track button click
document.getElementById('signup-btn').addEventListener('click', () => {
plausible('Signup');
});
// Track with properties
plausible('Purchase', { props: { plan: 'pro', value: '49' } });
</script>
Common goals to set up:
- Plausible → Site Settings → Goals → Add Goal
- Create goals for: signups, purchases, downloads, outbound links
- Enable outbound link tracking by adding
script.outbound-links.js - Enable file download tracking by adding
script.file-downloads.js
Step 5: Remove Cookie Consent Banner
Since Plausible doesn't use cookies, you can remove your cookie consent banner if analytics was the only reason for it. Check if other tools still require it (marketing pixels, etc.).
Feature Mapping
| GA4 Feature | Plausible Equivalent |
|---|---|
| Realtime view | ✅ Real-time dashboard |
| Pageviews | ✅ |
| Unique visitors | ✅ |
| Bounce rate | ✅ |
| Session duration | ✅ (visit duration) |
| Traffic sources | ✅ |
| UTM tracking | ✅ |
| Country/city | ✅ (country, region, city) |
| Device/browser | ✅ |
| Goals/Conversions | ✅ (goals with properties) |
| Funnels | ✅ |
| Custom events | ✅ |
| Ecommerce tracking | ✅ (revenue goals) |
| Cohort analysis | ❌ |
| User ID tracking | ❌ (by design — privacy) |
| Segments | ✅ (filters) |
| Data export | ✅ (CSV, API) |
What You'll Lose
- User-level tracking — Plausible tracks visits, not users (privacy by design)
- Demographic data — no age, gender, interests
- Behavior flow — no user journey visualization
- Integration with Google Ads — no conversion tracking for ad campaigns
- Free tier — Plausible is $9/month or self-hosted
What You'll Gain
- No cookie banners — cleaner UX
- Faster page loads — < 1 KB vs 45+ KB script
- Dashboard you'll actually use — everything on one page
- GDPR compliance — no DPA needed, no consent required
- Full data ownership (self-hosted)
- Shared dashboards — public or private links
Run Both Temporarily
During migration, run both analytics for 2-4 weeks to compare data:
<!-- Keep GA4 temporarily -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXX"></script>
<!-- Add Plausible -->
<script defer data-domain="yourdomain.com" src="https://plausible.io/js/script.js"></script>
Compare: pageviews, visitors, and top pages should be within 5-15% of each other (adblockers block GA more than Plausible).
Compare analytics tools on OSSAlt — privacy features, data ownership, and ease of use side by side.