What is Umami?
Umami is a privacy-focused, open-source web analytics tool. No cookies, no tracking, GDPR-compliant by default. It's the ethical alternative to Google Analytics — self-hosted with a clean API.
Quick Setup
git clone https://github.com/umami-software/umami
cd umami
npm install
npx prisma migrate deploy
npm run build
npm start
Or use Docker:
docker compose up -d
Add to Your Website
<script async src="https://your-umami.com/script.js" data-website-id="YOUR_WEBSITE_ID"></script>
One tag. No cookies. No consent banner needed.
The REST API
export UMAMI_URL="https://your-umami.com/api"
export UMAMI_TOKEN="your-api-token"
Get Website Stats
curl -s "$UMAMI_URL/websites/WEBSITE_ID/stats?startAt=1711584000000&endAt=1711670400000" \
-H "Authorization: Bearer $UMAMI_TOKEN"
Response:
{
"pageviews": {"value": 1234, "prev": 1100},
"visitors": {"value": 890, "prev": 800},
"visits": {"value": 950, "prev": 850},
"bounces": {"value": 312, "prev": 290},
"totaltime": {"value": 45600, "prev": 42000}
}
Page Views by URL
curl -s "$UMAMI_URL/websites/WEBSITE_ID/metrics?startAt=1711584000000&endAt=1711670400000&type=url" \
-H "Authorization: Bearer $UMAMI_TOKEN" | jq '.[:5]'
Referrers
curl -s "$UMAMI_URL/websites/WEBSITE_ID/metrics?type=referrer&startAt=1711584000000&endAt=1711670400000" \
-H "Authorization: Bearer $UMAMI_TOKEN"
Countries, Browsers, OS
# Countries
curl -s "$UMAMI_URL/websites/WEBSITE_ID/metrics?type=country&startAt=...&endAt=..." \
-H "Authorization: Bearer $UMAMI_TOKEN"
# Browsers
curl -s "$UMAMI_URL/websites/WEBSITE_ID/metrics?type=browser&startAt=...&endAt=..." \
-H "Authorization: Bearer $UMAMI_TOKEN"
# OS
curl -s "$UMAMI_URL/websites/WEBSITE_ID/metrics?type=os&startAt=...&endAt=..." \
-H "Authorization: Bearer $UMAMI_TOKEN"
Pageviews Over Time
curl -s "$UMAMI_URL/websites/WEBSITE_ID/pageviews?startAt=1711584000000&endAt=1711670400000&unit=hour" \
-H "Authorization: Bearer $UMAMI_TOKEN"
Custom Events
// Track custom events in your app
umami.track("signup_clicked", { plan: "pro", source: "landing" });
umami.track("purchase", { amount: 49.99, currency: "USD" });
# Query events via API
curl -s "$UMAMI_URL/websites/WEBSITE_ID/events?startAt=...&endAt=..." \
-H "Authorization: Bearer $UMAMI_TOKEN"
Manage Websites
# Create website
curl -X POST "$UMAMI_URL/websites" \
-H "Authorization: Bearer $UMAMI_TOKEN" \
-d '{"name": "My Blog", "domain": "blog.example.com"}'
# List websites
curl -s "$UMAMI_URL/websites" \
-H "Authorization: Bearer $UMAMI_TOKEN" | jq '.[].name'
Why Umami?
| Feature | Umami | Google Analytics | Plausible |
|---|---|---|---|
| Open source | Yes | No | Yes |
| Self-host | Yes | No | Yes |
| Cookies | None | Required | None |
| GDPR compliant | Yes | Needs consent | Yes |
| Real-time | Yes | Delayed | Yes |
| API | Full REST | Limited | REST |
| Price (self) | Free | Free | Free |
Need privacy-first analytics or custom dashboards?
📧 spinov001@gmail.com
🔧 My tools on Apify Store
GA4 or privacy-first analytics? What do you use?
Top comments (0)