Hanzo Analytics is a privacy-focused web analytics platform -- an alternative to Google Analytics.
<!-- Updated: 2026-03-26T15:03:36Z -->
Category: Hanzo Ecosystem Related Skills: hanzo/hanzo-platform.md, hanzo/hanzo-cloud.md, hanzo/hanzo-database.md
Hanzo Analytics is a privacy-focused web analytics platform -- an alternative to Google Analytics. Next.js 15 dashboard (port 3000) with Prisma ORM, PostgreSQL/ClickHouse storage, and a Go-based high-performance event collector. Includes anti-ad-blocker technology (encrypted tracker + WASM decryption). Live at analytics.hanzo.ai.
ghcr.io/hanzoai/analytics:latestRepo: hanzoai/analytics (Umami fork, v3.0.3).
| Item | Value | |------|-------| | UI | https://analytics.hanzo.ai | | Demo | https://analytics.hanzo.ai/share/LGazGOecbDtaIwDr/hanzo.ai | | Dev port | 3001 (Next.js dev) / 3000 (production) | | Image | ghcr.io/hanzoai/analytics:latest | | Package | @hanzo/analytics (v3.0.3) | | Database | PostgreSQL (required), ClickHouse (optional) | | ORM | Prisma 6 | | Collector | Go + Gin + ClickHouse (collector/) | | Health check | /api/heartbeat | | Repo | github.com/hanzoai/analytics | | License | MIT |
# compose.yml
services:
analytics:
image: ghcr.io/hanzoai/analytics:latest
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://analytics:analytics@db:5432/analytics
APP_SECRET: replace-me-with-a-random-string
depends_on:
db:
condition: service_healthy
restart: always
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:3000/api/heartbeat"]
interval: 5s
timeout: 5s
retries: 5
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: analytics
POSTGRES_USER: analytics
POSTGRES_PASSWORD: analytics
volumes:
- analytics-db-data:/var/lib/postgresql/data
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
analytics-db-data:
git clone https://github.com/hanzoai/analytics.git
cd analytics
cp .env.example .env # Set DATABASE_URL
pnpm install
pnpm build # Creates tables on first run, default: admin/analytics
pnpm start # http://localhost:3000
<script defer src="https://analytics.hanzo.ai/script.js"
data-website-id="YOUR-WEBSITE-ID"></script>
┌──────────────────────┐
│ analytics.hanzo.ai │
│ (Next.js 15) │
│ │
│ ┌────────────────┐ │
Browser ─────────▶│ │ /api/send │ │──── PostgreSQL
(tracker.js) │ │ /api/batch │ │ (sessions, events,
│ │ /api/realtime │ │ users, teams, etc.)
│ │ /api/websites │ │
│ │ /api/reports │ │
│ │ /api/auth │ │
│ └────────────────┘ │
└──────────────────────┘
┌──────────────────────┐
│ collector (Go) │
High-volume ─────▶│ Gin HTTP server │──── ClickHouse
events │ event.go │ (event_data,
│ forward/ │ session_data)
│ writer/ │
└──────────────────────┘
tracker.bin (binary blob)decrypt.wasm (WebAssembly) decrypts in-browser memorytrack())| Route | Purpose | |-------|---------| | /api/send | Receive tracking events | | /api/batch | Batch event ingestion | | /api/realtime | Real-time visitor data | | /api/websites | Website CRUD | | /api/reports | Report CRUD | | /api/teams | Team management | | /api/users | User management | | /api/auth | Authentication | | /api/links | URL shortener | | /api/pixels | Tracking pixels | | /api/share | Public dashboard sharing | | /api/heartbeat | Health check |
DATABASE_URL=postgresql://user:pass@localhost:5432/analytics # Required
APP_SECRET=random-secret-string # Required
CLICKHOUSE_URL=http://localhost:8123 # Optional
| Issue | Cause | Solution | |-------|-------|----------| | Build fails on first run | Missing DATABASE_URL | Set DATABASE_URL in .env before pnpm build | | Default login not working | Changed by script | Default is admin / analytics, use npm run change-password | | Ad blocker blocks events | Tracker detected | Use encrypted tracker pipeline (enabled by default) | | High event volume slow | PostgreSQL bottleneck | Deploy Go collector with ClickHouse backend | | Geo data missing | No GeoIP database | Run pnpm build-geo to download MaxMind DB | | Docker health check fails | Port not ready | Increase retries or wait for DB initialization |
hanzo/hanzo-platform.md - PaaS for deploying analyticshanzo/hanzo-cloud.md - Cloud dashboardhanzo/hanzo-database.md - PostgreSQL infrastructurehanzo/hanzo-kms.md - Secret management for APP_SECRETLast Updated: 2026-03-13 Category: Hanzo Ecosystem Related: analytics, tracking, privacy, web-analytics, events Prerequisites: PostgreSQL, Node.js 18.18+, Docker (optional)