Minilytics
Open-source, revenue-first web analytics for indie hackers and solo founders. It shows traffic sources, visitor behavior, and which source generated revenue, and can be self-hosted on Cloudflare's free plan.
Visit surendrapandar/minilyticsOverview
Minilytics is an open-source, self-hosted web analytics tool focused on revenue. It tracks visitors, conversion rate, revenue per visitor, bounce rate, session time, and online-now counts, with comparisons against the previous period. It shows where visitors came from, what they did, and which source led to payment, and it can run on Cloudflare's free plan.
Key Features
- Tracks visitors, revenue, conversion rate, revenue per visitor, bounce rate, session time, and online-now metrics with period-over-period changes.
- Visualizes visitors as a line chart and revenue as bars across hourly, daily, weekly, or monthly views with flexible date ranges.
- Attributes traffic by channel, referrer, campaign, keyword, and ref tags, and breaks down country, region, city, browser, OS, and device.
- Records pages, entry pages, exit links, button clicks, custom goals, and funnels.
- Provides a Journey list connecting each customer to source, amount, time to convert, and a visit-to-payment timeline.
- Supports multiple websites from one login and lets users click a dashboard row to filter the whole view.
Use Cases
- Indie hackers and solo founders can see which launch tweet, article, search page, or AI assistant referred paying visitors.
- Site owners can track signup button clicks, custom goals, and funnels to understand conversion behavior.
- Teams selling through Dodo Payments can connect payments and refunds to the visitor source that drove them.
- Developers can self-host a private analytics dashboard on their own Cloudflare account.
Getting Started
- Clone the repository, change into the project directory, and run npm install.
- Log in to Cloudflare with npx wrangler login, create a D1 database with npx wrangler d1 create minilytics, and paste the printed database_id into wrangler.jsonc.
- Set ADMIN_PASSWORD and SESSION_SECRET with npx wrangler secret put, then deploy with npm run deploy.
- After deployment, open the printed Workers URL, log in, add a website, and copy its script tag.
- Install the tracker on a site with a script tag using data-website-id and the Minilytics host.
Deployment & Requirements
- A free Cloudflare account, Node.js 20 or newer, and Git are required.
- Each deployment creates its own Cloudflare D1 database and requires ADMIN_PASSWORD and SESSION_SECRET secrets.
- The app deploys to Cloudflare Workers; a custom domain can be attached through Cloudflare's Domains & Routes settings.
- Revenue attribution with Dodo Payments requires configuring a Dodo webhook and pasting its signing secret into the site settings.
- The free Cloudflare plan provides limits such as 100,000 Worker requests per day, 100,000 D1 rows written per day, 5M D1 rows read per day, and 5 GB D1 storage.
Before You Adopt
- License: MIT. Review its terms before using, modifying, or distributing the project.
- Safari limits cookies set by JavaScript to at most seven days, so returning Safari visitors after a week may be counted as new.
- With Dodo payment links, checkout metadata may not always reach the payment, so the source recommends an additional return-page step.
- The free Cloudflare plan has request, D1 write/read, and storage limits; outgrowing them requires Workers Paid.