DEV Community

Cover image for I Built an Open-Source Alternative to Google Analytics + Hotjar
shohag miah
shohag miah

Posted on

I Built an Open-Source Alternative to Google Analytics + Hotjar

I was paying for Google Analytics (confusing), Hotjar ($80/mo for heatmaps), and a separate popup tool ($30/mo). Three dashboards, three scripts on my site, and nothing talked to each other.

So I built Seentics — one open-source tool that replaces all three.

What Seentics Does

Analytics — Real-time visitors, pageviews, bounce rate, session duration, traffic sources, UTM tracking, countries, browsers, devices. Like Plausible but with way more features.

Heatmaps — See where users click and how far they scroll. Supports desktop, tablet, and mobile viewports. Works on any page without code changes.

Session Replays — Watch full user sessions to find UX issues and bugs. Stored in S3-compatible storage with automatic PII masking.

Funnels — Build multi-step conversion funnels. See exactly where users drop off in your signup, checkout, or onboarding flow.

Goal Tracking — Track page visit goals, custom events with seentics.track('signup'), or auto-track clicks on CSS selectors like #buy-btn.

Behavioral Automations — This is the feature nobody else has in the privacy-first space. Trigger popups, banners, webhooks, or custom JavaScript based on real-time visitor behavior — exit intent, scroll depth, time on page.

The Tech Stack

Layer Technology
Backend API Go 1.24 (Gin)
Frontend Next.js 14, Tailwind CSS, shadcn/ui
Analytics DB ClickHouse
Metadata DB PostgreSQL 15
Object Storage S3-compatible (MinIO)
Caching Embedded Go cache

Why Go + ClickHouse?

Go handles concurrent HTTP requests extremely well — the event ingestion endpoint needs to handle thousands of requests per second with minimal latency. The tracking script sends a POST request, Go buffers it in memory, and batch-inserts into ClickHouse every second or every 1000 events (whichever comes first). Response time to the browser: under 5ms.

ClickHouse is a columnar database built for analytical queries. A query like "show me pageviews by country for the last 30 days" that would take 10+ seconds on PostgreSQL runs in 50ms on ClickHouse — even with millions of rows.

PostgreSQL handles everything that's not time-series: user accounts, site configurations, goals, automation rules.

The Tracking Script

Under 1KB. Compare that to GA4 (45KB+) or Hotjar (100KB+). No cookies, no fingerprinting, no PII collection.

Setup is one line in your HTML:

<script
  async
  src="https://seentics.com/trackers/seentics.js"
  data-site-id="YOUR_SITE_ID"
></script>
Enter fullscreen mode Exit fullscreen mode

Custom event tracking:

// Basic event
seentics.track('signup_click')

// With properties
seentics.track('purchase', { value: 49.99, plan: 'pro' })
Enter fullscreen mode Exit fullscreen mode

How It Compares

Feature Seentics Plausible Hotjar PostHog GA4
Real-time analytics Yes Yes No Yes Yes
Heatmaps Yes No Yes No No
Session replays Yes No Yes Yes No
Funnels Yes Yes Yes Yes Yes
Behavioral automations Yes No No No No
Privacy-first (no cookies) Yes Yes No Yes No
Open source Yes Yes No Yes No
Self-hostable Yes Yes No Yes No
Script size <1KB <1KB ~100KB ~25KB ~45KB

Self-Hosting

Requires Docker. That's it.

git clone https://github.com/Seentics/seentics.git
cd seentics
docker compose up -d --build
Enter fullscreen mode Exit fullscreen mode

Open http://localhost:3000 and you have a full analytics platform running.

Architecture

Browser --> Tracking Script --> Go Backend API (:3002)
                                     |
                   +-----------------+-----------------+
                   |                 |                 |
              ClickHouse        PostgreSQL           MinIO
              (events)          (metadata)         (replays)
Enter fullscreen mode Exit fullscreen mode

The tracking script is served by the Go backend and sends events directly to it. Events are buffered in memory and batch-inserted into ClickHouse. Session replay data goes to S3-compatible storage (MinIO for self-hosted, any S3 for cloud). PostgreSQL stores user accounts, site configs, goals, and automation rules.

What's Next

I'm working on AI-powered insights (anomaly detection, natural language queries), custom dashboards, email reports, and a WordPress plugin.

If you're interested:

I'd love feedback — what features would make you switch from your current analytics setup? What's missing?

Thanks for reading!

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.