Skip to content
IndieMakerList

Analytics · updated 2026-11-03

Can you vibe code a Google Analytics alternative?

Medium: Yes, with care You can build simple, privacy-friendly pageview analytics in a day, but it will not save money because Google Analytics is free.

4–10 h
MVP build time
$0–$46/mo
Your running cost
Free
Google Analytics Google Analytics 4 (standard)
No savings
Saved per year

The honest verdict

Google Analytics 4 costs nothing for almost every small site, so building your own is about privacy, simplicity and learning rather than savings. A cookieless tracker that records pageviews, referrers and countries is a good vibe coding project. Ingesting events reliably at scale, filtering bots, and keeping queries fast as data grows are where it gets harder, which is why indie tools like Plausible and Fathom exist as paid products.

Google Analytics is free web analytics from Google for traffic, sources, events and conversions. This page is about building your own version for personal or internal use, or to learn how this kind of product works, not about copying Google Analytics to compete with it. How we grade.

What's easy and what's hard

Easy with AI
  • A small tracking script that sends pageviews
  • Dashboard with visitors, top pages, referrers and countries
  • Cookieless counting with a daily rotating salt
  • Custom events such as signups
Hard (where AI won't save you)
  • Ingesting high event volume without losing data or slowing the site
  • Bot and spam filtering
  • Fast aggregate queries over months of raw events
  • Privacy law details such as IP handling and data residency
  • Ad blockers that block anything named analytics

Google Analytics feature checklist

Difficulty is for a solo builder using an AI coding tool. Skip means not worth building yourself.

FeatureDifficultyWhy
Tracking scriptEasyA few lines that post the URL, referrer and screen size; keep it under 2 KB.
Unique visitors without cookiesMediumHash IP plus user agent with a salt that rotates daily, and never store the raw IP.
Dashboard of pages, sources, countriesEasyGroup-by queries over an events table, rendered with a chart library.
Custom events and goalsEasyA named event call plus a goals table.
Bot filteringMediumUser agent lists and headless browser checks catch most of it.
High-volume ingestionHardPostgres works for small sites; busy sites need batching or a columnar store like ClickHouse.
Funnels and cohortsHardComplex queries that get slow quickly.
Google Ads and Search Console integrationSkipOnly GA has this tight integration with Google's ad products.

Build time and running costs

Your own version vs Google Analytics, at personal or small-team scale.

Build time
Working MVP for yourself
4–10 h
Polished, relied on daily
5–10 days
Google Analytics price (not independently verified)

Google Analytics 4 (standard): Free

Free for standard properties; the enterprise Analytics 360 tier is sold through sales.

Source: marketingplatform.google.com/about/analytics/compare. Prices change; check before deciding.

Running costPer monthNotes
Hosting for collector and dashboard$0–$20Edge or serverless functions on a free tier for low traffic.
Database$0–$25Supabase or Neon free tier for small sites; ClickHouse Cloud costs more at volume.
Domain or subdomain$0–$1Serve the script from your own domain.
Total$0–$46/moGoogle Analytics is free, so the reasons to build are control, privacy and learning, not money.

Recommended vibe coding tools

Vibe coding hub →

Claude Code

Strong at the ingestion endpoint, hashing logic and SQL aggregation queries.

v0

Generates a clean dashboard UI with charts that you can drop into Next.js.

Replit

Runs the collector and database in one place, useful for a quick prototype.

Starter prompt

Paste it into your tool, then ask for a plan before any code. Edit the specifics to match what you need.

prompt.txt
Build a lightweight, cookieless web analytics tool for my own websites (internal use).
Stack: Next.js API routes on the edge, Postgres (Supabase), a dashboard with charts.
Data model: sites (id, domain, owner_id), events (id, site_id, ts, path, referrer_host, country, device, browser, visitor_hash, name), salts (date, value).
Features:
1. A tracking script under 2 KB that sends a pageview on load and on client-side route changes, plus window.track(name) for custom events.
2. Collector endpoint that accepts events only for registered domains, derives country from request headers, and computes visitor_hash = sha256(daily_salt + site_id + ip + user_agent). Never store raw IPs.
3. Delete salts older than one day so visitors cannot be tracked across days.
4. Dashboard (login required) with visitors, pageviews, top pages, referrers, countries and devices for a date range.
5. Basic bot filtering by user agent.
Security: validate and size-limit every incoming field, check the Origin header against the site domain, rate-limit the collector, keep dashboards private with row level security, and add a privacy page describing what is collected.

Security pitfalls to check

AI tools often get these wrong by default. Check each one before anyone else uses the app.

  1. 01An open collector endpoint lets anyone flood your database with fake events; check origin, validate fields and rate-limit.
  2. 02Storing raw IP addresses turns analytics into personal data under GDPR.
  3. 03Dashboards without per-site access control leak one site's traffic to other users.
  4. 04Unescaped paths or referrers rendered in the dashboard can carry XSS payloads.
  5. 05A heavy tracking script hurts your Core Web Vitals; keep it tiny and async.

Indie makers who built a real analytics business

They went far past the prototype: support, payments, reliability and years of iteration. Their profiles show what that took.

Or just use these indie-made tools instead

If you need Google Analytics's job done rather than a project, these are built and supported by independent makers.

All Google Analytics alternatives →

Simple, cookie-free, open source web analytics that respects visitor privacy.

by Uku Täht
Fathom Analytics logo

Fathom Analytics

usefathom.com

Simple, privacy-first website analytics with no cookie banners required.

by Jack Ellis
Umami logo

Umami

umami.is

Open-source, privacy-focused web and product analytics; self-host free or use Umami Cloud.

by Mike Cao
DataFast logo

DataFast

datafa.st

Revenue-first web analytics that shows which traffic sources bring paying customers.

$31K/moTrustMRR ↗by Marc Lou
CountVisits logo

CountVisits

countvisits.com

Web analytics you pay for once and use forever.

by John Rush
Simple Analytics logo

Simple Analytics

simpleanalytics.com

Privacy-first, cookieless web analytics and Google Analytics alternative.

$50K+ MRRby Adriaan van Rossum

What building it teaches you

You learn event ingestion, privacy-preserving visitor counting and how to write aggregate SQL that stays fast.

Can you vibe code these too?

All 50 →

Vibe coding Google Analytics: FAQ

Can you vibe code a Google Analytics alternative?

Medium. You can build simple, privacy-friendly pageview analytics in a day, but it will not save money because Google Analytics is free.

How long does it take to vibe code a Google Analytics alternative?

A working personal or internal MVP takes about 4–10 h with a tool like Claude Code. A polished version you would rely on every day takes about 5–10 days, mostly spent on ingesting high event volume without losing data or slowing the site.

How much does it cost to run your own Google Analytics alternative?

Expect $0–$46/mo at personal or small-team scale (hosting for collector and dashboard, database, domain or subdomain). Free for standard properties; the enterprise Analytics 360 tier is sold through sales.

Can I build my own Google Analytics?

A simple pageview tracker with a dashboard is a one or two day vibe coding project. Matching GA4's funnels, attribution and ad integrations is not realistic.

Will building my own analytics save money compared to Google Analytics?

No. Google Analytics 4 is free for normal sites, so the reasons to build or switch are privacy, simpler reports and avoiding cookie banners.

What is a privacy-friendly Google Analytics alternative?

Indie-made tools such as Plausible, Fathom, Simple Analytics and Umami count visitors without cookies, and Umami and Plausible can be self-hosted.

Is it legal to build your own Google Analytics clone?

Building your own tool that solves the same problem is common and generally fine. Copying Google Analytics's code, design assets, brand name or content is not. Use your own name and design, respect their terms of service, and get proper advice if you plan to sell it. This page is not legal advice.