Umami Analytics Setup in MakerKit
Add Umami to your MakerKit application for privacy-focused, cookie-free analytics that comply with GDPR without consent banners.
Umami is a privacy-focused analytics platform that tracks page views and events without cookies. Because it does not use cookies or collect personal data, you can use Umami without displaying cookie consent banners in the EU. Umami can be self-hosted for complete data ownership or used via Umami Cloud.
Why Choose Umami
| Feature | Umami | Google Analytics |
|---|---|---|
| Cookies | None | Yes |
| GDPR consent required | No | Yes |
| Self-hosting | Yes | No |
| Pricing | Free (self-hosted) or paid cloud | Free |
| Data ownership | Full | |
| Session replay | No | No |
| Feature flags | No | No |
Use Umami when: You want simple, clean metrics without privacy concerns. Ideal for landing pages, documentation sites, and applications where marketing attribution is not critical.
Prerequisites
Before starting:
- Create an Umami account at umami.is or self-host
- Create a website in your Umami dashboard
- Note your Website ID and Script URL
In Umami Cloud, find these at: Settings > Websites > Your Website > Edit.
Installation
Install the Umami plugin using the MakerKit CLI:
npx @makerkit/cli@latest plugins installSelect Umami from the list. This creates the plugin at packages/plugins/umami.
Add the plugin as a dependency to the analytics package:
pnpm add "@kit/umami@workspace:*" --filter "@kit/analytics" -DConfiguration
Register the provider in your analytics configuration:
packages/analytics/src/index.ts
import { createUmamiAnalyticsService } from '@kit/umami';import { createAnalyticsManager } from './analytics-manager';import type { AnalyticsManager } from './types';export const analytics: AnalyticsManager = createAnalyticsManager({ providers: { umami: createUmamiAnalyticsService, },});Add environment variables:
.env.local
NEXT_PUBLIC_UMAMI_HOST=https://cloud.umami.is/script.jsNEXT_PUBLIC_UMAMI_WEBSITE_ID=your-website-idSelf-Hosted Configuration
If self-hosting Umami, point to your instance:
.env.local
NEXT_PUBLIC_UMAMI_HOST=https://analytics.yourdomain.com/script.jsNEXT_PUBLIC_UMAMI_WEBSITE_ID=your-website-idReplace the URL with the path to your Umami instance's tracking script.
Environment Variables
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_UMAMI_HOST | Yes | URL to the Umami tracking script |
NEXT_PUBLIC_UMAMI_WEBSITE_ID | Yes | Your website ID from Umami |
NEXT_PUBLIC_UMAMI_DISABLE_LOCALHOST_TRACKING | No | Set to false to enable localhost tracking |
Development Configuration
By default, Umami does not track localhost. Enable it for development testing:
.env.local
NEXT_PUBLIC_UMAMI_HOST=https://cloud.umami.is/script.jsNEXT_PUBLIC_UMAMI_WEBSITE_ID=your-website-idNEXT_PUBLIC_UMAMI_DISABLE_LOCALHOST_TRACKING=falseVerification
After configuration:
- Deploy to a non-localhost environment (or enable localhost tracking)
- Open your application and navigate between pages
- Check your Umami dashboard > Realtime
- Confirm page views appear
Custom Event Tracking
Umami tracks page views automatically. For custom events:
import { analytics } from '@kit/analytics';void analytics.trackEvent('Button Clicked', { button: 'signup', location: 'header',});Events appear in Umami under Events in your website dashboard.
Using with Other Providers
Umami can run alongside other providers:
packages/analytics/src/index.ts
import { createUmamiAnalyticsService } from '@kit/umami';import { createPostHogAnalyticsService } from '@kit/posthog/client';import { createAnalyticsManager } from './analytics-manager';export const analytics = createAnalyticsManager({ providers: { umami: createUmamiAnalyticsService, posthog: createPostHogAnalyticsService, },});This setup provides Umami's clean metrics alongside PostHog's product analytics.
Self-Hosting Umami
Umami can be self-hosted using Docker:
docker-compose.yml
version: '3'services: umami: image: ghcr.io/umami-software/umami:postgresql-latest ports: - '3001:3000' environment: DATABASE_URL: postgresql://user:pass@db:5432/umami DATABASE_TYPE: postgresql depends_on: - db db: image: postgres:15 environment: POSTGRES_DB: umami POSTGRES_USER: user POSTGRES_PASSWORD: pass volumes: - ./data:/var/lib/postgresql/dataSelf-hosting gives you:
- Complete data ownership
- No usage limits
- Custom data retention policies
- Compliance with data residency requirements
Limitations
Umami is intentionally simple. It does not provide:
- User identification (
analytics.identify()is a no-op) - Session replay
- Feature flags
- Server-side tracking
- Funnel analysis
If you need these features, consider PostHog instead.
Troubleshooting
No data appearing
- Verify you are not on localhost (or enable localhost tracking)
- Check that the Website ID matches your Umami dashboard
- Confirm the script URL is correct and accessible
Ad blocker interference
Umami is sometimes blocked by ad blockers. If this is an issue:
- Self-host Umami on a subdomain (e.g.,
analytics.yourdomain.com) - Use a generic script path (e.g.,
/stats.jsinstead of/script.js)
Events not tracked
- Ensure event names and properties are strings
- Check that the event appears in Umami's Events tab, not just Page Views
Next Steps
- Learn about Analytics and Events for event tracking patterns
- Consider PostHog if you need user identification or feature flags
- Create a custom provider for other analytics services