Analytics that lives in your Cloudflare account.
Web analytics, product analytics, session replay and A/B tests. Deployed by one command, queried by your coding agent, and open source. Your data never leaves your account.
npx @glassanalytics/cli init
Or paste this into your coding agent:
Add Glass analytics to this project: run npx @glassanalytics/cli init, track signups and purchases, then show me today's visitors.
Needs a Cloudflare account and an API token. Takes about two minutes.
Pricing to signup, last 30 days
- Viewed pricing4,812
- Started signup1,394
- Completed signup1,041
Biggest drop-off: into "Started signup" (29.0% of the previous step).
From zero to answers
-
Run one command
npx @glassanalytics/cli initcreates a D1 database, an R2 bucket and a Worker in your account, then writes instructions and an MCP server config for your agent. -
Add one script tag
Or let your agent do it. Pageviews, clicks, errors and web vitals arrive straight away; custom events are one line.
-
Ask your agent
"Why did signups drop last week?" It runs funnels, reads session replays as text, and can ship a fix behind an experiment.
What that looks like
An example session in a coding agent with the Glass MCP server.
Signups dropped this week. Find out why.
overview from: "-7d"
Visitors steady (+2%). signup_completed down 31% vs 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 with_errors: true
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 replaced it with a fallback and added a test. Want me to ship it behind a flag and watch the funnel?
Four tools on one event stream
- Web analytics
- Visitors, pages, referrers, campaigns, countries and devices, plus errors and Core Web Vitals. Cookieless mode needs no consent banner.
- Product analytics
- Trends, funnels and retention on any event, filtered or broken down by any event or person property. Raw SQL when you need it.
- Session replay
- rrweb recordings with inputs masked, and a text transcript of each session (clicks, rage clicks, errors) that agents can read.
- Flags and experiments
- Feature flags evaluated in your Worker, and A/B tests with Bayesian results and sample-ratio checks.
Your account, your data
- Events, people and recordings live in your D1 database and R2 bucket. Glass has no servers.
- Keep data in the EU with
glass init --eu. - Delete a person and everything about them with one call.
- This page loads nothing from third parties. Neither does the Glass dashboard.
What it costs
Your Cloudflare bill, nothing else. The default D1 store runs on the Workers free plan for small sites; Workers Paid ($5 a month) raises the limits. For large volumes, --lake streams events to Iceberg tables in R2 and queries them with Basin SQL.
How it compares
| Glass | Google Analytics | PostHog | Plausible | |
|---|---|---|---|---|
| Where your data lives | Your Cloudflare account | PostHog cloud, or your servers | Plausible cloud, or your servers | |
| Open source | Yes (MIT) | No | Yes | Yes |
| Session replay | Yes | No | Yes | No |
| Feature flags and A/B tests | Yes | No | Yes | No |
From each product's public documentation. Spotted something out of date? Open an issue on GitHub.
Open source, and yours to change
Glass is MIT licensed. The Worker that runs in your account is the code in the repository, so you can read it, fork it, or add a query type, an MCP tool or a storage engine. The contributing guide shows where each lives.
Start in your terminal
npx @glassanalytics/cli init