Google Analytics 4 has been the default web analytics tool for millions of websites since Universal Analytics was officially sunset in July 2023. But a growing number of businesses, from solo marketers to enterprise teams, are now choosing to migrate from Google Analytics to open-source alternatives. This guide walks you through every step of that migration, whether you pick Matomo, Plausible, Umami, or another tool entirely.
This article is part of our comparison guide to open-source analytics platforms, where we evaluate the leading GA4 replacements side by side. If you have not read that yet, start there to understand the landscape before you begin your migration.
What follows is a hands-on, step-by-step process you can follow in a single sprint. By the end, you will have a fully functional analytics stack running independently of Google, with your data under your control.
Why Migrate Away from GA4?
The reasons companies leave GA4 fall into several overlapping categories. Understanding them helps you build internal buy-in and justify the project to stakeholders.
Data Privacy and Regulatory Pressure
The most common driver is compliance. In January 2022, the Austrian Data Protection Authority ruled that the use of Google Analytics violated the GDPR. France’s CNIL followed with a similar ruling weeks later. Italy’s Garante and Denmark’s Datatilsynet issued comparable decisions throughout 2022 and 2023. These were not theoretical warnings. Companies received formal orders to stop transferring European visitor data to US servers through Google Analytics.
Even after Google introduced the EU-based data processing option in GA4, privacy advocates and regulators continued to scrutinize the arrangement. The fundamental issue remains: Google processes analytics data on infrastructure it controls, and the data can be accessed under US surveillance law regardless of where the servers sit physically.
Data Sampling and Accuracy
GA4 applies data sampling when your queries exceed certain thresholds. For free accounts, reports that span large date ranges or combine multiple dimensions will show sampled data, meaning Google extrapolates from a subset rather than reporting on every session. This introduces inaccuracy that compounds as your traffic grows. Many marketing teams have discovered their GA4 conversion numbers do not match their CRM data, and sampling is often the culprit.
Complexity and Interface Frustration
GA4 introduced an event-based data model that replaced the familiar session-based model of Universal Analytics. While technically more flexible, the new interface frustrated a large portion of its user base. Reports that used to require two clicks now require building custom explorations. Many marketers report spending more time configuring GA4 than actually analyzing data.
Vendor Lock-In
Your GA4 data lives on Google’s servers. Exporting it requires a BigQuery integration (which Google charges for at scale) or painstaking API work. If Google changes its terms, deprecates features, or sunsets GA4 the way it did Universal Analytics, you start over. With an open-source tool, you own the database. You can back it up, fork it, or migrate it to a different host without asking permission.
Real Companies Making the Switch
The European Parliament’s own website migrated to Matomo. The German government’s digital services run on Matomo. Plausible has publicly documented how companies like Basecamp adopted it for simplicity and privacy. Umami gained traction among developer-led startups who wanted a lightweight, self-hosted solution without the overhead of a full-featured platform. These are not fringe experiments. They are deliberate, production-grade decisions by teams that evaluated the trade-offs.
Choosing Your Replacement
Before you migrate, you need to pick your destination. The three leading open-source analytics platforms each serve a different profile. For a deeper breakdown, see our full comparison of Matomo, Plausible, and Fathom.
Matomo is the closest direct replacement for GA4. It offers event tracking, goal tracking, funnels, heatmaps (via plugins), tag management, and a full reporting API. It can be self-hosted or used as a cloud service. If you need feature parity with GA4, Matomo is the default choice.
Plausible is built for simplicity. It provides a single-page dashboard with pageviews, referrers, countries, devices, and goal conversions. It is cookieless by default, which means you can often remove your cookie consent banner entirely. It is ideal for content sites, SaaS marketing pages, and teams that want answers without configuration.
Umami is developer-focused. It is lightweight, self-hosted, and easy to deploy on platforms like Vercel, Railway, or a plain VPS. It tracks pageviews, events, and referrers with a clean interface. It appeals to technical teams who want full control and minimal overhead.
| Criteria | Matomo | Plausible | Umami |
|---|---|---|---|
| GA4 feature parity | High | Low | Medium |
| Self-hosted option | Yes | Yes | Yes |
| Cloud-hosted option | Yes (paid) | Yes (paid) | Yes (paid) |
| Cookieless tracking | Optional | Default | Default |
| Built-in tag manager | Yes | No | No |
| Ecommerce tracking | Yes | No | No |
| Funnels and cohorts | Yes (plugin) | Funnels only | No |
| Custom events | Yes | Yes | Yes |
| API access | Full REST API | Yes | Yes |
| Setup complexity | Medium-High | Low | Low-Medium |
| Best for | Enterprise, compliance | Marketing teams, content | Developers, startups |
Pick the tool that matches your actual needs, not the one with the most features. Most marketing teams use fewer than 10% of GA4’s capabilities. A simpler tool that your team actually uses is worth more than a powerful one that nobody opens.
Pre-Migration Checklist
Before you touch any code, audit what you currently have in GA4. This prevents the most common migration failure: forgetting to replicate something important.
Audit Your GA4 Configuration
- Events: List every custom event you are tracking. Go to GA4 > Admin > Events and export the list. Note which events are auto-collected, which are enhanced measurement, and which are custom.
- Conversions: Document every event marked as a conversion. For each one, note its name, any conditions or parameters, and which team uses it for reporting.
- Custom dimensions and metrics: Export these from Admin > Custom definitions. If you are passing user properties or event parameters as custom dimensions, document the exact parameter names.
- Audiences: If you have built audiences in GA4 for remarketing or reporting, list them and their conditions.
- Integrations: Note every tool connected to GA4: Google Ads, Search Console, BigQuery, Looker Studio dashboards, CRM platforms, or third-party tools pulling data via the GA4 API.
Export Your Historical Data
GA4 does not offer a simple “export everything” button. Your options are:
- BigQuery Export: If you have a BigQuery link set up, your raw event data is already there. Export it and store it. This is the most complete option.
- GA4 Data API: Use the Google Analytics Data API to pull reports programmatically. This gives you aggregated data (not raw events) but covers your key metrics and dimensions.
- Manual CSV Exports: For each report you care about, set the date range to “all time” and export as CSV. This is tedious but works for small setups.
- Third-party tools: Services like Supermetrics, Funnel.io, or open-source scripts can automate the export of GA4 data into spreadsheets or databases.
Separate What You Use from What Is Configured
This is the most valuable step. Go through your list and mark each item as “actively used,” “occasionally referenced,” or “configured but never used.” Most GA4 installations have dozens of events and dimensions that nobody looks at. Do not waste time migrating unused tracking. Migrate only what your team actually relies on for decisions.
Step 1: Set Up Parallel Tracking
Never do a hard cutover. Install your new analytics tool alongside GA4 and run both simultaneously for at least 30 days. This gives you a comparison period to validate data accuracy and lets your team get comfortable with the new interface before GA4 disappears.
Install Both Scripts
Here is an example showing GA4 and Matomo running side by side in your site’s <head> section:
<!-- Google Analytics 4 (keep during parallel period) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
<!-- Matomo (new analytics) -->
<script>
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.yourdomain.com/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'),
s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js';
s.parentNode.insertBefore(g,s);
})();
</script>
If you chose Plausible instead, replace the Matomo block with:
<!-- Plausible (new analytics) -->
<script defer data-domain="yourdomain.com"
src="https://plausible.io/js/script.js"></script>
For Umami:
<!-- Umami (new analytics) -->
<script async defer
data-website-id="your-website-id"
src="https://analytics.yourdomain.com/umami.js"></script>
If you are running a self-hosted analytics setup, make sure your server can handle the additional tracking requests during the parallel period. Monitor CPU and disk usage for the first few days.
What to Compare During Parallel Tracking
Create a simple spreadsheet and record these metrics weekly from both platforms: total pageviews, unique visitors, top 10 pages, top 5 referral sources, and conversion counts for your key goals. Do not expect the numbers to match exactly. We will address the expected discrepancies in Step 5.
Step 2: Migrate Goals and Conversions
Goals and conversions are the most critical part of your migration. Traffic numbers are useful, but conversion tracking is what ties analytics to business outcomes.
Map GA4 Events to Your New Platform
GA4 uses an event-based model where every interaction is an event with parameters. Your new platform may use a slightly different model. Here is how common GA4 events translate:
| GA4 Event | Matomo Equivalent | Plausible Equivalent | Umami Equivalent |
|---|---|---|---|
| page_view | Tracked automatically | Tracked automatically | Tracked automatically |
| scroll | Tracked automatically (if enabled) | Not built-in | Not built-in |
| click (outbound) | Outbound link tracking (built-in) | Outbound link tracking (built-in) | Custom event required |
| file_download | Download tracking (built-in) | File download tracking (built-in) | Custom event required |
| form_start / form_submit | Form analytics plugin | Custom event via JS | Custom event via JS |
| purchase | Ecommerce tracking (built-in) | Custom event + revenue | Custom event |
| sign_up | Goal: event match | Custom event goal | Custom event |
| generate_lead | Goal: event match | Custom event goal | Custom event |
| add_to_cart | Ecommerce tracking | Custom event + revenue | Custom event |
| video_start / video_complete | Media analytics plugin | Custom event via JS | Custom event via JS |
Implementing Custom Events
For any custom event you tracked in GA4, you will need to add equivalent tracking calls. In Matomo, a custom event looks like this:
// Matomo custom event
_paq.push(['trackEvent', 'Category', 'Action', 'Name', Value]);
In Plausible:
// Plausible custom event
plausible('Signup', {props: {plan: 'premium'}});
In Umami:
// Umami custom event
umami.track('signup', {plan: 'premium'});
Go through your “actively used” event list from the pre-migration checklist. For each event, write the equivalent tracking call in your new platform and add it to your codebase. Test each one individually before moving on.
Step 3: Recreate UTM Campaign Tracking
The good news here is that UTM parameters are a universal standard, not a Google proprietary feature. Every open-source analytics platform reads utm_source, utm_medium, utm_campaign, utm_term, and utm_content from the URL automatically.
What You Need to Do
In most cases, nothing changes. Your existing campaign URLs with UTM parameters will continue to work with Matomo, Plausible, and Umami without any modification. The parameters are parsed from the URL on page load and attributed to the visit.
However, verify these details:
- Existing campaign URLs: If you have active email campaigns, social media links, or ad campaigns with UTM parameters, they will continue to work. Do not change them.
- Source and medium mapping: GA4 has default channel groupings (Organic Search, Paid Search, Email, Social, etc.) that automatically categorize traffic based on source and medium values. Your new tool may group them differently. Check how your new platform categorizes channels and adjust your UTM conventions if needed.
- Google Ads auto-tagging: If you use Google Ads with auto-tagging (gclid parameter), that data will no longer flow into your analytics after migration. Switch to manual UTM tagging for your Google Ads campaigns or use Matomo’s Google Ads integration.
For a comprehensive look at how UTM tracking works in a cookieless context, read our guide on UTM parameters and campaign tracking without cookies.
Update Your UTM Builder
If your team uses Google’s Campaign URL Builder, switch to a platform-agnostic UTM builder or create a simple spreadsheet template. The parameters themselves are identical. The only thing that changes is that you no longer need to reference GA4-specific documentation for channel definitions.
Step 4: Replace Google Tag Manager
Google Tag Manager is one of the stickier dependencies in a GA4 setup. Whether you need to replace it depends on how you use it.
When You Can Skip GTM Replacement
If you use GTM solely to deploy the GA4 script and a few basic event triggers, you probably do not need a tag manager at all. Most open-source analytics tools are a single script tag. Place it directly in your site’s template or CMS, and you are done. Direct script placement is simpler, faster, and eliminates one more third-party dependency.
When You Need a Tag Manager
If your GTM container manages multiple third-party scripts (chat widgets, A/B testing tools, remarketing pixels, heatmap tools), you still need a tag management solution. Your options are:
- Matomo Tag Manager: If you chose Matomo, it includes a built-in tag manager that can replace GTM entirely. It supports custom HTML tags, triggers based on page views, clicks, form submissions, and custom events. The interface is similar enough to GTM that your team can transition without a steep learning curve.
- Keep GTM for non-analytics tags: There is nothing wrong with keeping GTM to manage other scripts while removing only the GA4 tag from it. Add your new analytics script directly to the page and let GTM handle everything else. This is a pragmatic middle ground.
- Direct placement: For simpler sites, place each script directly in your theme template. This is the cleanest approach for sites with fewer than five third-party integrations.
Step 5: Validate Data Accuracy
After running parallel tracking for at least two weeks, it is time to compare the numbers. This step is where most migrations either build confidence or create unnecessary panic, so approach it with the right expectations.
What to Compare
Pull these metrics from both GA4 and your new tool for the same date ranges:
- Total pageviews: Should be within 5-15% of each other.
- Unique visitors / users: Expect larger discrepancies here (see below).
- Top pages: The ranking of your most-visited pages should be similar, even if absolute numbers differ.
- Traffic sources: Referral sources should rank in roughly the same order.
- Bounce rate: GA4’s bounce rate is calculated differently than most other tools (it is based on engagement rather than single-page sessions). Do not compare this number directly.
- Conversions: Your key goals should fire at similar rates. If conversion counts are dramatically different, investigate the event tracking implementation first.
Why Your New Tool Will Show More Traffic
If you switch to a cookieless analytics tool like Plausible or Umami, you will likely see 15-30% more visitors compared to GA4. This is not an error. It happens because:
- No consent banner blocking: GA4 requires cookies, which means it only tracks visitors who accept your cookie consent banner. Studies show 30-50% of EU visitors reject tracking cookies. A cookieless tool counts everyone.
- No ad blockers blocking: Many ad blockers and privacy extensions specifically block Google Analytics. Most open-source tools, especially self-hosted ones, are not on ad blocker lists.
- No data sampling: Your new tool reports on 100% of the data. GA4 may have been sampling your reports without clearly indicating it.
Document these discrepancies and explain them to stakeholders before removing GA4. The higher numbers in your new tool are likely more accurate, not less.
Step 6: Remove GA4 and Go Live
Once you are confident in your new setup, it is time to cut the cord. Do this methodically.
Remove the GA4 Tracking Code
Delete the GA4 script from your site’s <head> section, from Google Tag Manager (if applicable), and from any server-side tracking implementations. Search your entire codebase for references to gtag, G-XXXXXXXXXX (your measurement ID), and googletagmanager.com/gtag. Remove them all.
Update Your Privacy Policy
Your privacy policy almost certainly mentions Google Analytics by name. Update it to reference your new analytics tool instead. If you have moved to a cookieless tool, you can simplify your privacy policy significantly. If you are self-hosting, note that data is processed on your own servers and not shared with third parties.
Remove or Simplify Your Cookie Banner
If Google Analytics was the only reason you had a cookie consent banner, and your new tool is cookieless, you may be able to remove the banner entirely. Audit all cookies your site sets to confirm. This is one of the most satisfying benefits of migrating: a cleaner user experience with no consent pop-ups.
Notify Your Team
Send a clear communication to everyone who uses analytics data:
- What changed and why.
- Where to find the new dashboards.
- Login credentials or access instructions.
- A brief explanation of why numbers may look different from GA4.
- Who to contact with questions.
Update Internal Dashboards
If you had Looker Studio dashboards, Google Sheets integrations, or other tools pulling from the GA4 API, switch them to your new platform’s API. Matomo, Plausible, and Umami all provide REST APIs that can feed into most BI and reporting tools.
Common Migration Pitfalls
Having helped document dozens of analytics migrations, these are the mistakes that come up repeatedly.
Losing Historical Data
This is the number one regret. Once you lose access to your GA4 property (or once Google changes its data retention policies), your historical data is gone. Export it before you start the migration, not after. Even imperfect exports (aggregated CSV reports) are better than nothing.
Not Mapping All Events
Teams frequently migrate pageview tracking and basic goals but forget about custom events buried in their GTM container. A developer added scroll depth tracking two years ago, and marketing has been using it in reports without knowing where it comes from. The pre-migration audit catches this, but only if you do it thoroughly.
Team Resistance
People resist change, especially when they have spent years learning GA4’s interface. Address this head-on: provide training sessions, create a cheat sheet mapping GA4 report locations to their equivalents in the new tool, and give the team at least 30 days of parallel access before removing GA4. Let them build confidence gradually.
Expecting Identical Numbers
No two analytics tools will produce identical numbers. They use different counting methodologies, session definitions, and bot filtering rules. Set this expectation early. The goal is not matching numbers. The goal is having reliable, consistent data from a tool you trust and control. If your top pages, traffic trends, and conversion rates tell the same story in both tools, the migration is successful, even if the absolute numbers differ by 20%.
Migrating Everything at Once
Large organizations sometimes try to migrate analytics, tag management, A/B testing, and attribution all in one project. This almost always fails. Migrate analytics first. Stabilize. Then tackle the next dependency. Each tool in your marketing stack can be migrated independently.
After Migration: What to Optimize
Once GA4 is gone and your new tool is the single source of truth, take advantage of features and workflows that were not possible or practical before.
Build Custom Dashboards
Most open-source analytics tools let you create focused dashboards for different teams. Build a dashboard for the marketing team showing traffic sources, campaign performance, and conversion trends. Build another for the product team showing feature usage and user flows. In Matomo, custom dashboards are built-in. In Plausible, the API can feed dashboards in Grafana or similar tools.
Set Up Automated Email Reports
Matomo supports scheduled email reports out of the box. Plausible sends weekly or monthly traffic summaries via email. Configure these immediately. Regular reports keep your team engaged with the data and reduce the “I forgot to check analytics” problem.
Leverage API Integrations
All three platforms offer APIs that let you pull analytics data into other tools. Feed conversion data into your CRM. Display real-time visitor counts on internal screens. Trigger Slack notifications when traffic spikes. These integrations are often easier with open-source tools because the APIs are well-documented and there are no rate-limiting surprises.
Explore Features GA4 Did Not Have
Depending on your platform, you now have access to capabilities GA4 either lacked or locked behind paywalls:
- 100% data ownership: Query your raw data directly in the database. Run SQL queries for custom analysis that no analytics interface supports.
- No data sampling ever: Every report is based on complete data, regardless of date range or query complexity.
- Full visitor privacy: With cookieless tracking, you respect visitor privacy by default rather than treating it as a compliance checkbox.
- Heatmaps and session recordings: Matomo offers these as plugins. With GA4, you needed a separate tool like Hotjar.
- Transparent methodology: Open-source tools publish their tracking code. You can audit exactly how a visit is counted, how a session is defined, and how bot traffic is filtered. No black box.
Bottom Line
Migrating away from GA4 is not a weekend project, but it is not a six-month enterprise initiative either. For most websites, the full process, from audit to GA4 removal, takes four to six weeks, with the parallel tracking period being the longest phase.
The technical work is straightforward: install a script, map your events, compare numbers, and cut over. The harder part is organizational, getting your team comfortable with a new interface and setting the right expectations about data differences.
What you gain is substantial: full ownership of your analytics data, freedom from regulatory risk, more accurate visitor counts, and a simpler, faster tool that your team will actually use. For most organizations, the only regret is not doing it sooner.
Start with the platform comparison if you have not chosen a tool yet, or dive into our complete guide to self-hosted analytics if you want to run everything on your own infrastructure.
