Product analytics that lives in your Cloudflare account.
Web analytics, funnels and retention, session replay, feature flags and A/B tests. Open source, deployed with one command, and ready for your coding agent. Your data never leaves your account.
npx dataflare-cli initOr paste this into your coding agentAdd Dataflare analytics to this project: run `npx dataflare-cli init`, track signups and purchases, then show me today's visitors.

WITH ev AS (
SELECT e.*,
CASE WHEN e.user_id IS NOT NULL AND e.user_id <> '' THEN e.user_id ELSE COALESCE(i.person_id, e.person_id) END AS pid
FROM events e
LEFT JOIN (
SELECT distinct_id, MIN(person_id) AS person_id
FROM identities
WHERE project = 'demo'
GROUP BY distinct_id
) i ON i.distinct_id = e.distinct_id
WHERE e.project = 'demo'
AND e.ts_ms >= 1791282506946
AND e.ts_ms < 1793874506946
AND e.event IN ('$pageview')
)
SELECT bucket, COUNT(DISTINCT distinct_id) AS visitors, COUNT(*) AS pageviews
FROM (SELECT ((ts_ms / 86400000) * 86400000) AS bucket, distinct_id FROM ev) t
GROUP BY bucket ORDER BY bucket LIMIT 5000
- MITopen source
- 4.5 KBbrowser SDK, gzipped
- 37MCP tools for agents
- 1command to deploy
- $0on Workers Free for small sites
One event stream, five tools
Everything a product team checks, in one place
Dataflare replaces the separate tools for web stats, product analytics, session replay and experiments. They share one event stream, so a funnel step links to the replays of the people who dropped out, and an experiment reads the same events as your reports.
Every visitor, source and page, at a glance
The numbers you check every morning: visitors, page views, sessions, bounce rate and time on site against the previous period, with sources, campaigns, pages, countries and devices. Click any row to filter the whole report.
- Core Web Vitals and JavaScript errors on the same page
- UTM campaigns and channels, with conversion per source
- Cookieless mode: nothing stored on the device

Funnels, retention and trends on any event
Ask product questions without a data team: where people drop out of signup, which week’s users stick around, how revenue splits by plan. Filter and break down by any event or person property, or a saved cohort.
- Trends, funnels and retention, with the previous period overlaid
- People and cohorts: identify() joins anonymous visits to accounts
- Read-only SQL on raw events when a chart isn’t enough

Watch the session, or read it
Recordings with every input masked, plus a timeline of what went wrong: rage and dead clicks, errors with stack frames, failed requests and console errors. Each session is also a text transcript your agent can read.
- Record a sample of sessions, and every session with an error
- Search by what happened: errors, rage clicks, events, pages
- Patterns across sessions: the most frustrating elements and errors

Ship behind a flag, then prove it worked
Feature flags evaluated in your own Worker, with rollouts and targeting. Experiments on the same events as your analytics, with conversion per variant, the probability to beat control, lift intervals and sample-ratio checks.
- Bayesian results you can read without a statistics course
- Ship the winner in one click: the flag serves it to everyone
- Your agent can create, start and read experiments

Every number shows the query behind it
Turn on the SQL switch and every panel shows the query that produced it. Copy it, change it, or start from scratch in the SQL editor. The same SQL runs on D1 and on the lake store.
- Read-only SQL in the dashboard, the CLI and MCP
- Schema browser, results as a table or a chart, copy as CSV
- Nothing is hidden: the Worker in your account is the open-source code

How it works
No Dataflare server. No Dataflare account. No Dataflare bill.
Dataflare is a Worker, a D1 database and an R2 bucket in your own Cloudflare account. The Worker that runs is the open-source code in the repository.
-
Run one command
npx dataflare-cli initcreates the database, the replay bucket and the Worker, sends a test event, and writes agent instructions and an MCP config into your project. -
Add one script tag
Or let your agent do it. Page views, clicks, errors and Core Web Vitals arrive straight away. Custom events are one line:
glass.capture('signup_completed'). -
Ask
Open the dashboard, or ask your agent "Why did signups drop last week?" Upgrades ship from your CI, never from a laptop.
Built for coding agents
Your agent can install it, query it and act on it
Analytics usually stops at a dashboard. Dataflare gives your agent the same access you have, through an MCP server, a CLI with --json everywhere and an HTTP API. Every answer carries the SQL that produced it and a link to the same view, so you can check its work.
overviewsqllist_eventsdescribe_eventdefine_eventinstrumentproperty_valueslist_person_propertiessearch_personsget_personlist_insightsget_insightsave_insightdelete_insightlist_cohortssave_cohortcount_cohortdelete_cohort- all 37 tools
Signups dropped this week. Find out why.
overview from: "-7d"
Visitors steady (+2%). signup_completed down 31% vs the previous period.
query_funnel steps: pricing → signup_started → signup_completed · breakdown: browser
Safari: 412 started, 38 completed (9.2%). Chrome 64.0%, Firefox 61.5%.
list_replays did_event: signup_started · not_event: signup_completed
summarise_replay session: "01a2…"
00:41 Rage-clicked "Create account" (button) ×5
00:42 ERROR TypeError: crypto.randomUUID is not a function
Safari 15 has no crypto.randomUUID, so the signup form throws on submit. I've added a fallback and a test. Want me to ship it behind a flag and watch the funnel?
What it costs
Your Cloudflare bill. That's it.
There is no Dataflare subscription. You pay Cloudflare's list prices for the Worker, database and storage Dataflare uses, and most sites fit inside the free plan or the $5 Workers Paid plan.
How it compares
The core of PostHog or Amplitude, in your own account
Dataflare isn't the right tool for everyone, and each comparison says where the other product is the better choice.
| Feature | Dataflare | PostHog | Google Analytics | Plausible | Amplitude |
|---|---|---|---|---|---|
| Where your data lives | Your own Cloudflare account (D1 and R2) | PostHog Cloud (US or EU), or your own servers | Google's servers | Plausible Cloud (EU), or your own servers (Community Edition) | Amplitude's cloud (US or EU) |
| Source code | Open source, MIT | Open source (MIT, with some paid features under a separate licence) | Proprietary | Open source (AGPL-3.0, Community Edition) | Proprietary |
| What you pay | Your Cloudflare bill: $0 on Workers Free for small sites, $5/month Workers Paid above that | Free monthly allowance, then usage-based per product | Free (GA4); Analytics 360 is a paid enterprise tier | From $9/month for 10k monthly pageviews; 30-day free trial | Free plan (2M events/month); paid plans scale with events or users |
| Cookieless mode | Yes | Yes (configurable persistence) | No; uses cookies (consent mode can limit them) | Yes, always | Configurable |
| Web analytics | Yes, with Core Web Vitals and errors | Yes | Yes | Yes | Yes |
| Funnels and retention | Yes: trends, funnels, retention, cohorts | Yes, extensive | Yes (explorations) | Funnels on Business plans and above | Yes, extensive |
| Session replay | Yes, with a text transcript for agents | Yes, web and mobile | No | No | Yes |
| Feature flags and A/B tests | Yes: flags in your Worker, Bayesian experiment results | Yes | No | No | Yes (Amplitude Experiment) |
| Raw SQL on your events | Yes, read-only SQL in the dashboard, CLI and MCP | Yes (HogQL / SQL insights) | Through BigQuery export | No (Stats API) | Through data exports and warehouse syncs |
More: Dataflare vs PostHog · Dataflare vs Google Analytics · Dataflare vs Plausible · Dataflare vs Amplitude · Dataflare vs Mixpanel · Dataflare vs Umami · Dataflare vs Cloudflare Web Analytics
Questions
Frequently asked
Is Dataflare free?
The software is free and MIT licensed. It runs in your Cloudflare account, so you pay Cloudflare's list prices and nothing else. A small site fits in the Workers Free plan ($0). Above that, the Workers Paid plan is $5 a month and includes 10 million requests and 50 million D1 rows written; most sites never go past it. The calculator shows your number.
Where is my data stored?
In a D1 database and an R2 bucket in your own Cloudflare account. There is no Dataflare server: nothing is sent to the Dataflare project or any third party. Add --eu at install to keep data in the EU jurisdiction.
Does my site have to be on Cloudflare?
No. Any website or app can send events to the Dataflare Worker on its workers.dev address. If your domain is on Cloudflare, you can also serve Dataflare from a path on it (--route example.com serves it at /_glass), which keeps it first-party and out of reach of most ad blockers.
Do I need a cookie banner?
In cookieless mode Dataflare stores nothing on the device and never stores IP addresses. Whether you need consent depends on your jurisdiction and on everything else your site does, so take your own legal advice. How cookieless mode works.
What happens when I outgrow D1?
A D1 database holds up to 10 GB on Workers Paid, which is tens of millions of events. Set GLASS_RETENTION_DAYS to keep a rolling window, or install with --lake (beta) to stream events into Apache Iceberg tables in R2, which have no size limit.
Can my coding agent use it?
dataflare init writes AGENTS.md, a Claude Code skill and an MCP server entry into your project. The agent can then query trends, funnels, retention, people and replays, run read-only SQL, and create flags and experiments. Every answer comes with the SQL that produced it and a dashboard link.
How is it different from PostHog?
PostHog is a hosted platform with many more products. Dataflare covers the core (web and product analytics, replay, flags and experiments) and runs in your own Cloudflare account, with no vendor bill. Full comparison.
Can I get my data out?
It is already yours: a SQLite database in your account. Query it with SQL in the dashboard or CLI, export it with wrangler d1 export, or point any Iceberg reader at the lake tables.
Is it ready for production?
Dataflare is new (0.x) and used in production by its authors. The D1 store, SDK, dashboard, MCP server and CLI are covered by unit, integration and browser end-to-end tests. The lake store is marked beta because it depends on Cloudflare products that are themselves in beta.
Open source
Read it, fork it, add to it
Dataflare is MIT licensed. Adding a query type, an MCP tool, a storage engine or a framework snippet is one file each, and the roadmap marks good first issues.
Two minutes from here to your first chart
You need a Cloudflare account and an API token.
npx dataflare-cli init