Skip to main content

How to Migrate from Google Analytics to Plausible

·OSSAlt Team
google analyticsplausibleanalyticsprivacymigration

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)

  1. Sign up at plausible.io
  2. Add your domain
  3. 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:

  1. Go to Plausible → Site SettingsImport Data
  2. Click Google Analytics
  3. Authorize the Google connection
  4. Select the GA property to import
  5. 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:

  1. PlausibleSite SettingsGoalsAdd Goal
  2. Create goals for: signups, purchases, downloads, outbound links
  3. Enable outbound link tracking by adding script.outbound-links.js
  4. Enable file download tracking by adding script.file-downloads.js

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 FeaturePlausible 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.