Analytics Setup
Privacy-first analytics that don't require cookie consent banners.
Privacy-First Analytics
All recommended analytics providers are GDPR compliant and don't use cookies, meaning you don't need a cookie consent banner.
Umami Analytics (Recommended)
- • No cookies, GDPR compliant by default
- • Self-hosted or cloud options
- • Simple, clean interface
- • Free tier available
Setup Steps
1. Sign up for Umami
- • Cloud: https://umami.is
- • Self-hosted: https://github.com/umami-software/umami
2. Get your Website ID
- • Create a new website in Umami dashboard
- • Copy the Website ID (looks like:
abc123-def456-ghi789)
3. Add to .env.local
NEXT_PUBLIC_UMAMI_ID="your-website-id"
NEXT_PUBLIC_UMAMI_SCRIPT="https://cloud.umami.is/script.js"If self-hosting, change the script URL to your domain:
NEXT_PUBLIC_UMAMI_SCRIPT="https://analytics.yourdomain.com/script.js"4. Track Custom Events
import { trackEvent, AnalyticsEvents } from '@/utils/analytics';
// Track purchase clicks
trackEvent(AnalyticsEvents.PURCHASE_CLICKED, {
price: 29,
currency: 'USD'
});
// Track feature usage
trackEvent(AnalyticsEvents.FEATURE_USED, {
feature: 'export_pdf'
});Best Practices
Track Conversion Funnel
- •
purchase_clicked→checkout_opened→license_activated
Monitor Feature Usage
Track which features drive conversions to optimize your product
A/B Test Pricing
Test $19 vs $29 vs $39 to find optimal price point
Troubleshooting
Analytics not tracking
- • Check that Website ID is correct in .env.local
- • Verify script URL is accessible
- • Check browser console for errors
- • Ensure ad blockers aren't blocking the script
Events not appearing
- • Wait 5-10 minutes for data to appear
- • Check event name matches exactly
- • Verify trackEvent is being called