Setting Up Privacy-Focused Analytics with Plausible

Google Analytics is under fire for privacy violations across Europe. Learn how to switch to Plausible, a lightweight, privacy-first analytics solution that doesn't require cookie consent banners.

Analytics dashboard showing website statistics

Google Analytics has been declared illegal in several EU countries due to GDPR violations. Austria, France, Italy, and Denmark have all ruled that using Google Analytics violates European privacy law because it transfers personal data to the United States without adequate protection.

If you're looking for a GDPR-compliant alternative that still gives you the insights you need, Plausible Analytics is an excellent choice. In this guide, we'll walk you through everything you need to know to make the switch.

Why Switch from Google Analytics?

Beyond the legal issues, there are many compelling reasons to switch to Plausible:

Did You Know?

Plausible is used by thousands of EU businesses and was founded in Estonia. It's fully GDPR compliant and endorsed by privacy advocates including the French CNIL.

Step 1: Create Your Plausible Account

Getting started with Plausible takes just a few minutes:

  1. Visit plausible.io and click "Start free trial"
  2. Enter your email address and create a password
  3. Add your website domain (e.g., example.com)
  4. Choose your data region (EU is the default)

Plausible offers a 30-day free trial with no credit card required. After the trial, plans start at just €9/month for up to 10,000 monthly pageviews.

Step 2: Add the Tracking Script

Once your account is set up, you'll receive a simple JavaScript snippet to add to your website. Here's what it looks like:

<script defer data-domain="yourdomain.com"
  src="https://plausible.io/js/script.js"></script>

Add this script to the <head> section of your website, on every page you want to track. Here's how to do it for common platforms:

WordPress

You have several options for WordPress:

  1. Official Plugin: Install the "Plausible Analytics" plugin from the WordPress plugin directory. Enter your domain in settings, and you're done.
  2. Theme Header: Add the script to your theme's header.php file, just before the closing </head> tag.
  3. Code Snippets Plugin: Use a plugin like "Insert Headers and Footers" to add the script without editing theme files.

Shopify

  1. Go to Online Store > Themes
  2. Click Actions > Edit code
  3. Find theme.liquid in the Layout folder
  4. Paste the script just before </head>

Next.js / React

// In your _app.js or layout file
import Script from 'next/script'

export default function App({ Component, pageProps }) {
  return (
    <>
      <Script
        defer
        data-domain="yourdomain.com"
        src="https://plausible.io/js/script.js"
      />
      <Component {...pageProps} />
    </>
  )
}
Code editor showing website implementation

Step 3: Verify Installation

After adding the script, verify it's working correctly:

  1. Visit your website in a browser
  2. Open your Plausible dashboard
  3. You should see "1 current visitor" appear within seconds

If you don't see any data, check that:

Pro Tip

Some ad blockers block analytics scripts. Plausible offers a proxy script option that routes through your domain, making it unblockable while still respecting privacy.

Step 4: Configure Custom Events (Optional)

Want to track more than just pageviews? Plausible supports custom events for tracking button clicks, form submissions, file downloads, and more.

First, update your script to include the custom events extension:

<script defer data-domain="yourdomain.com"
  src="https://plausible.io/js/script.tagged-events.js"></script>

Then add the plausible-event-name class to elements you want to track:

<button class="plausible-event-name=Signup+Click">
  Sign Up Now
</button>

Or trigger events via JavaScript:

// Track a custom event
plausible('Signup', {props: {plan: 'Premium'}});

Step 5: Set Up Goals and Funnels

Goals help you track important conversions on your website:

  1. Go to your site settings in Plausible
  2. Click on "Goals"
  3. Click "Add Goal"
  4. Choose between pageview goals or custom event goals

Common goals to track include:

Step 6: Remove Google Analytics

Once you've verified Plausible is working, remove Google Analytics from your site:

  1. Remove the Google Analytics script (usually starts with gtag.js or analytics.js)
  2. Remove any Google Analytics plugins
  3. Remove cookie consent banners if they were only needed for Google Analytics
  4. Update your privacy policy to reflect the change

You can also delete your Google Analytics account entirely, which will remove all historical data Google has collected about your visitors.

Plausible vs Google Analytics: Feature Comparison

Feature Plausible Google Analytics 4
Cookie-free Yes No
GDPR Compliant Yes, fully Disputed in EU
Script Size <1 KB 45+ KB
Real-time Data Yes Yes
Custom Events Yes Yes
Goals/Conversions Yes Yes
Campaign Tracking Yes (UTM) Yes
API Access Yes Yes
Data Ownership 100% yours Shared with Google
Self-hosting Option Yes No
Dashboard showing clean analytics interface

Alternative European Analytics Tools

Plausible isn't the only privacy-focused analytics option. Here are other European alternatives to consider:

Common Questions

Will I lose historical data?

Yes, Plausible cannot import your Google Analytics history. However, you can export your GA data before deleting it, or run both services in parallel for a transition period to build up historical data in Plausible.

How accurate is Plausible without cookies?

Plausible uses a privacy-friendly method to identify unique visitors using a hash of the IP address and user agent, which is discarded daily. This provides accurate daily unique visitor counts without tracking individuals across days.

Can I use Plausible for multiple sites?

Yes, you can add unlimited websites to your Plausible account. Pricing is based on total monthly pageviews across all sites.

Is Plausible open source?

Yes, Plausible is fully open source under the AGPL license. You can view the code on GitHub and even self-host it if you prefer.

Conclusion

Switching from Google Analytics to Plausible is straightforward and offers significant benefits: GDPR compliance, faster page loads, no cookie banners, and simpler analytics that still tell you what you need to know about your website's performance.

The migration typically takes less than an hour, and you'll wonder why you didn't switch sooner. Your visitors will appreciate the improved privacy, and you'll appreciate the cleaner, more focused dashboard.

Ready to Switch?

Explore our full guide to privacy-focused analytics tools to find the best solution for your needs.