For your own sites, analytics comes down to a small tracking script, an endpoint that writes hits to SQLite, and a dashboard of pages, referrers, campaigns and goals. An agent builds that, cookie-free, in one sitting. A quick build skips what Matomo's hosted plan adds on top: heatmaps, session recordings, A/B tests and a tag manager. Matomo itself is open source, so if you want all of it without the bill, running the free On-Premise edition on your own server is the other way out.
Before you buildMatomo has no free cloud plan, but Matomo On-Premise is the same software for free if you can run PHP and MySQL, and Cloudflare Web Analytics is free for basic page counts.
Build me a self-hosted, cookie-free web analytics tool to replace Matomo Cloud for my own sites. Requirements: - Node.js 22 + TypeScript with Fastify on port 4800; the dashboard is server-rendered HTML with Chart.js, no front-end build step. - Storage: better-sqlite3 at ./data/analytics.db with raw hits plus a nightly daily-rollup table, so a year of data loads in under a second. - Tracker: /t.js under 2 KB sends page views (path, referrer, UTM tags, screen width), single-page-app route changes and custom events from window.track(name, props) with navigator.sendBeacon to POST /collect. - No cookies or localStorage: visitor id = SHA-256(daily salt + site + IP + user agent), with the salt replaced at midnight. Store the country from a local DB-IP Lite file (`maxmind` package), never the IP. Honour Global Privacy Control; drop bots with `isbot`. - Dashboard behind ADMIN_PASSWORD from .env: visitors, visits, page views, bounce rate, time on page; top pages, entry and exit pages, referrers, campaigns, countries, browsers and devices (`ua-parser-js`); any date range compared with the one before; clicking a row filters the whole dashboard. - Goals: a URL pattern or an event name, with conversions and rate; one funnel of up to 5 steps. - Several sites, each with its own snippet; CSV export of every table and a read-only JSON API. - No accounts beyond the admin password, no telemetry. - Out of scope: heatmaps, session recordings, A/B tests and a tag manager. - README: the snippet, running behind Caddy for HTTPS, backing up the SQLite file, and exactly what is and isn't stored about a visitor.
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 Matomo Cloud.
Add a Matomo importer to the analytics tool in this folder. Requirements: - Read MATOMO_URL, MATOMO_TOKEN and the site id from .env. - Call the Matomo Reporting API (VisitsSummary.get, Actions.getPageUrls, Referrers.getAll) one day at a time for a date range I pass in, with format=JSON and the token sent as a POST parameter. - Store the results as daily rollups marked "imported", so the dashboard shows them seamlessly before the switch date. - Skip days already imported; print a summary at the end. - Update the README with where to create the token in Matomo.
Add a weekly email report to the analytics tool in this folder. Requirements: - Every Monday at 7:00 (node-cron), build a summary per site: visitors and page views versus the previous week, top 5 pages, top 5 referrers, goal conversions. - Send it as a plain HTML table through SMTP settings in .env (nodemailer). - A --dry-run flag prints the email instead of sending it. - Update the README.
Add log import to the analytics tool in this folder. Requirements: - A command that reads Caddy JSON or Nginx combined access logs, including rotated .gz files, and turns page requests into hits for a given site. - Ignore assets, non-200 responses and bots (`isbot`); hash visitors the same way the tracker does. - Remember the last line read so a cron job can run it every 10 minutes. - Mark log hits so the dashboard can show or hide them. - Update the README with the cron line.
Add ecommerce tracking to the analytics tool in this folder. Requirements:
- window.track('purchase', { orderId, revenue, currency, items }) records an
order; the same orderId is never counted twice.
- Dashboard: revenue, orders and conversion rate per referrer, campaign and
landing page, for any date range.
- Convert currencies to one reporting currency with daily ECB rates, cached in
SQLite.
- Update the README with the snippet for a checkout's thank-you page.Organisations that left Google Analytics over privacy want the same depth of reports without running a PHP and MySQL server, and Matomo Cloud gives them that with EU hosting and a vendor they can name in a GDPR review. Agencies also like keeping dozens of sites and users under one bill.
Estimate · A $4–6 VPS holds years of data for a few small sites; it's free if you already have a server. The build is token usage on your agent plan.
Checked 2026-10-13 against Matomo Cloud's docs: 1, 2, 3, 4, 5
| Plan | Monthly | Annual, per month | What you get |
|---|---|---|---|
| Cloud 50,000 hits | $24.61 | $20.51 | 50,000 hits a month, 30 websites, 30 team members, 24 months of raw data, reports kept forever, 1,500 heatmap pageviews and 150 session recordings a month. |
| Cloud 100,000 hits | $42.51 | $35.43 | Same allowances, 100,000 hits a month. |
| Cloud 300,000 hits | $83.91 | $69.92 | Same allowances, 300,000 hits a month. |
| Cloud 1 million hits | $192.43 | $160.36 | Same allowances, 1 million hits a month. |
| Cloud 5 million hits | $919.65 | $766.38 | Same allowances, 5 million hits a month. |
| Cloud over 10 million hits | custom | — | Custom allowances and a Customer Success Manager. |
| On-Premise Community (self-hosted) | $0 | $0 | All core reports with no hit limit; you run PHP and MySQL yourself. |
No free cloud plan, only a trial without a card; the self-hosted Community edition is free.
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 $24.61 a month on the Cloud, 50,000 hits a month plan, $295.32 a year (checked 2026-10-13).
Heatmaps and session recordings; Funnels, cohorts, multi-channel attribution and A/B tests; The tag manager and the Google Analytics importer; EU hosting in Frankfurt with ISO 27001, backups and updates handled for you; Ecommerce, media and form analytics reports. If any of those matter to you, keep paying.
Yes: Matomo On-Premise (open source), Umami (open source), Plausible Community Edition (open source).