Fathom's core is a collector endpoint, a daily-rotating visitor hash, a SQLite or Postgres table of hits and a dashboard of top pages, referrers and countries. An agent builds that in one sitting, and open projects such as Umami and GoatCounter already prove the shape. What you give up is hosting that absorbs traffic spikes, bot filtering from Fathom's own data, and first-party script domains that dodge ad blockers. For one personal site on a small server that matters little.
Before you buildFathom has no free hosted plan. Umami and GoatCounter are free to self-host, and GoatCounter's hosted service is free for reasonable use; try them before building.
Build me a small privacy-friendly web analytics server to replace Fathom Analytics. Requirements: - Node.js 22 + TypeScript: a Hono server on @hono/node-server with server-rendered JSX pages and uPlot charts. `npm start` serves the dashboard and the collector on http://localhost:4710. - Storage: better-sqlite3 in ./data/fathom.db: a hits table (site, ts, pathname, referrer host, utm_source, utm_medium, utm_campaign, country, browser, os, device, visitor_hash, is_unique) and an events table (site, ts, name, value_cents). Hourly rollup tables feed the charts. - Script: GET /script.js returns under 2 KB of JavaScript that sends the pathname, referrer and UTM parameters to POST /collect on load and on history.pushState. No cookies or storage. window.fathom.trackEvent(name, valueCents) records a goal. Honour Do Not Track. - Visitors: hash a daily random salt + site + IP + user agent; a hit is unique the first time that hash is seen that day. Keep salts for 24 hours only and never store IPs. Country from a DB-IP Lite .mmdb file (path in .env) with `maxmind`; browser and OS from `ua-parser-js`. - Bots: drop requests that `isbot` flags, that lack a user agent, or whose IP falls in the CIDR ranges of a file you refresh weekly from AWS's ip-ranges.json. Show a count of blocked hits on the dashboard. - Dashboard: one page per site with a date range, a visitors and pageviews chart, and tables for pages, referrers, countries, browsers, UTM campaigns and events with total value. Clicking a row filters the rest. - Sharing: an optional public link per site, with an optional password from .env. - Export: a CSV download of any table for a date range. - Single owner: one password in .env, signed cookie. SITES in .env lists accepted domains. No accounts, no telemetry, local-first. - Out of scope: email reports, a Google Analytics importer, an API, multiple users, funnels. - README: the script tag to paste, running behind Caddy for HTTPS, and a warning that the collector must be reachable from visitors' browsers, so a laptop behind a home router will not do.
Opens your agent with the prompt filled in, you press enter. Or copy it and paste it into an empty folder.
The first prompt builds the core. Run these one at a time in the same folder to grow it into your own Fathom Analytics.
Add email reports to the analytics server in this folder. Requirements: - A weekly report per site, sent Monday 08:00 in the owner's timezone through nodemailer with SMTP settings in .env. - Content: visitors and pageviews against the previous week (percent change), the top 5 pages, top 5 referrers and goals completed, as plain HTML with no images. - A "send now" button in the dashboard and a log of sent reports in SQLite. - Update the README.
Add first-party serving to the analytics server in this folder. Requirements: - Make the script path and the collect path configurable in .env (SCRIPT_PATH, COLLECT_PATH) so a reverse proxy can mount them on the site's own domain, e.g. /stats/a.js. - Update the script to read the collect path from its own tag instead of a constant. - Add a Caddyfile snippet and an nginx location block to the README. - Test that the collector still accepts hits behind a path prefix.
Add a historical import to the analytics server in this folder. Requirements: - A CLI command `npm run import -- <site> <file.csv>` for a daily CSV with date, pageviews and visitors columns. - Store imported days in their own table; charts add them to live data and mark them dashed. - Refuse a file that overlaps days already collected live, and print the first overlapping date. - Update the README with how to produce the CSV.
People pay for a dashboard they actually open, no consent banner to design, and no server to patch. Fathom is cloud-only and closed source, so the choice is between paying and running something like Umami yourself.
Estimate · Free on a server you already run, about $5 a month for a small VPS otherwise. The build itself is token usage on your agent plan.
Checked 2026-10-19 against Fathom Analytics's docs: 1, 2, 3, 4, 5
| Plan | Monthly | Annual, per month | What you get |
|---|---|---|---|
| 100K pageviews | $15 | $12.50 | Up to 100,000 pageviews a month and 50 sites; events, UTM and revenue tracking, API, shared dashboards, unlimited email reports and CSV exports. |
| 200K pageviews | $25 | $20.83 | Up to 200,000 pageviews a month, same features. |
| 500K pageviews | $45 | $37.50 | Up to 500,000 pageviews a month, same features. |
| 1M pageviews | $60 | $50 | Up to 1,000,000 pageviews a month, same features. |
| 2M pageviews | $100 | $83.33 | Up to 2,000,000 pageviews a month, same features. |
| Over 25M pageviews | custom | — | Custom allowance on a separate high-traffic page. |
No free plan, only a 7-day trial with a card on file. The old self-hosted Fathom Lite is free but no longer gets features.
Yes. An AI coding agent such as Claude Code, Codex or Cursor can build a usable personal version in one session with the prompt on this page, running on your own machine.
About $15 a month on the 100,000 pageviews a month plan, $180 a year (checked 2026-10-19).
Hosting that scales through traffic spikes and keeps the dashboard up; Bot and datacenter filtering maintained by Fathom; Custom domains for the script so ad blockers leave it alone, and EU isolation of visitor data; Email reports, the Google Analytics importer and shared dashboards with passwords; Revenue and campaign reports with a maintained API. If any of those matter to you, keep paying.
Yes: Umami (open source), Plausible Community Edition (open source), GoatCounter (open source).