How to Migrate from Google Analytics to Umami
How to Migrate from Google Analytics to Umami
Umami is a free, open source Google Analytics alternative. Self-host it for $0, get a clean dashboard, and stop sending your users' data to Google. Here's how to switch.
Why Umami?
- Completely free — self-hosted, no usage limits
- No cookies — no consent banners needed
- Simple dashboard — one page, everything you need
- Multi-site — track multiple websites from one instance
- Teams — share dashboards with your team
- API — full REST API for custom integrations
Step 1: Deploy Umami
# Clone and deploy with Docker
git clone https://github.com/umami-software/umami.git
cd umami
cp .env.example .env
# Edit .env
# DATABASE_URL=postgresql://umami:password@db:5432/umami
docker compose up -d
Default login: admin / umami — change immediately.
Or use Umami Cloud (free tier available at cloud.umami.is).
Step 2: Add Your Website
- Log in to Umami dashboard
- Settings → Websites → Add website
- Enter your domain name
- Copy the tracking code
Step 3: Replace the GA Snippet
Remove Google Analytics and add Umami:
<!-- Remove GA4 -->
<!-- Add Umami -->
<script
defer
src="https://your-umami.com/script.js"
data-website-id="your-website-id"
></script>
Next.js:
// app/layout.tsx
import Script from 'next/script';
export default function RootLayout({ children }) {
return (
<html>
<head>
<Script
defer
src="https://your-umami.com/script.js"
data-website-id="your-website-id"
/>
</head>
<body>{children}</body>
</html>
);
}
Step 4: Set Up Event Tracking
// Track custom events
umami.track('signup-click');
// Track with data
umami.track('purchase', { plan: 'pro', amount: 49 });
// Track via data attributes (no JS needed)
// <button data-umami-event="signup-click">Sign Up</button>
Data attributes are the easiest approach — just add data-umami-event to any HTML element.
Step 5: Share Dashboards
- Settings → Websites → click your site → Share URL
- Enable sharing → copy the public link
- Share with your team or embed in internal tools
Feature Mapping
| GA4 Feature | Umami Equivalent |
|---|---|
| Pageviews | ✅ |
| Visitors | ✅ |
| Bounce rate | ✅ |
| Visit duration | ✅ |
| Traffic sources | ✅ (referrers) |
| UTM parameters | ✅ |
| Countries | ✅ |
| Devices/Browsers | ✅ |
| Custom events | ✅ |
| Realtime | ✅ |
| API | ✅ |
| Multi-site | ✅ |
| Team access | ✅ |
| Data export | ❌ (API access) |
| Funnels | ❌ |
| User tracking | ❌ (privacy-first) |
The Bottom Line
Umami is the simplest GA replacement — deploy, add a script tag, and you have privacy-friendly analytics. No cost, no cookies, no complexity. Self-host on a $5 VPS and track unlimited websites.
If you need more advanced features (funnels, revenue tracking, historical import), consider Plausible. If you want the simplest, free-est option, Umami is the way.
Compare analytics tools on OSSAlt — privacy, features, and self-hosting options side by side.