# Dataflare Analytics: open-source product analytics in your own Cloudflare account

Web analytics, funnels and retention, session replay, feature flags and A/B tests. Open source (MIT), deployed with one command, and ready for your coding agent. Your data never leaves your Cloudflare account.

```sh
npx dataflare-cli init
```

Or paste this into your coding agent:

> Add Dataflare analytics to this project: run `npx dataflare-cli init`, track signups and purchases, then show me today's visitors.

- Live demo: https://dataflare.dev/demo/
- Docs: https://dataflare.dev/docs/
- Pricing calculator: https://dataflare.dev/pricing/
- Comparisons: [PostHog](https://dataflare.dev/vs/posthog/), [Google Analytics](https://dataflare.dev/vs/google-analytics/), [Plausible](https://dataflare.dev/vs/plausible/), [Amplitude](https://dataflare.dev/vs/amplitude/), [Mixpanel](https://dataflare.dev/vs/mixpanel/), [Umami](https://dataflare.dev/vs/umami/), [Cloudflare Web Analytics](https://dataflare.dev/vs/cloudflare-web-analytics/)

## At a glance

- MIT licensed; browser SDK 4.5 KB gzipped; 37 MCP tools; version 0.6.1.
- Runs as a Worker, a D1 database and an R2 bucket in your Cloudflare account. No Dataflare server or account.
- Costs Cloudflare's list prices: $0 on Workers Free for small sites, $5/month on Workers Paid for most others.

## Questions

### 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](https://dataflare.dev/pricing/) 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](https://dataflare.dev/guides/cookieless-analytics/).

### 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](https://dataflare.dev/vs/posthog/).

### 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.
