Documentation
How to send your site's traffic, your product's events and your revenue to mettr, and how to read them on the dashboard, in alerts, on a TV or through an AI assistant.
mettr shows who is on your site right now, what they do in your product, where they came from, what broke and what it earns, live. These pages explain how data gets in and what you can do with it once it is there.
How data gets in
- The browser script sends page views, navigation in single-page apps, outbound clicks, each page's Web Vitals and who is on the page right now. One line in your layout. See Browser script.
- A server SDK sends your product's own events (sign-ups, upgrades, exports), errors and sign-ins from your backend, where nothing can block them. There are SDKs for Laravel, plain PHP, Node.js, Next.js, Python, Ruby and Go, and the Events API for any other language.
- A platform's plugin does it with no code: WordPress, Statamic, Shopify, a Cloudflare Worker in front of any site, or the script pasted into a site builder.
- Connections bring in what other services know: revenue from Stripe, Paddle, Polar or your own billing, Search Console from Google, downloads and releases of your packages on Packagist, npm, PyPI and crates.io, stars, releases and issues of your GitHub repositories, and deploys from GitHub, GitLab, Bitbucket or any CI.
- History from before mettr comes from another tool (Google Analytics 4, Plausible, Simple Analytics, Umami, Matomo, GoatCounter) or through the Import API, and leaves as an export whenever you like.
Where to start
New to mettr? The Quick start takes you from an account to your first live visitor in a few minutes.
Already sending? Learn the dashboard, give your events names of your own with labels, set up alerts and reports, put the dashboard on an office TV, or let an AI assistant read your numbers through the MCP server.
Words used here
- Site: one website or product, with its own domains, keys and dashboard. A site belongs to a team.
- Event: one thing that happened, with a type:
pageview,event(your product's own, such assignup),error,revenue, and a few the script and SDKs send for you. - Visitor: a person on the site that day, told apart by a daily hash. The same person is a new visitor the next day, and no address or cookie is kept.
- Online: visitors seen in the last 90 seconds (the browser script sends a heartbeat every 30), or active in the last 5 minutes on a site with no script. Where the script runs, a client the server alone sees (a scraper fetching files) is not online, and sampled response times never count anywhere but their own panels.
- Bots and staff: crawlers, scanners and your own team are flagged as they arrive and left out of every number. Nothing is dropped.
Sending data
- Browser script One line in your layout sends page views, single-page app navigation, outbound clicks, scroll depth, time on page, Web Vitals and who is online, with no cookies.
- JavaScript The @mettr/browser package loads the browser script from your bundle and sends your product's events, safely during server rendering.
- Site builders Add mettr to a site made with Webflow, Framer, Ghost, Wix or Squarespace by pasting the browser script into the builder's custom code for the head.
Server SDKs
- Laravel The mettr/laravel package sends a Laravel app's page views, events, errors, sign-ins, failed jobs, response times and crawler visits, after the response has gone.
- PHP The mettr/mettr package sends any PHP app's own events, errors and subscriptions to mettr, with nothing to set up but a secret key.
- Node.js The @mettr/node package sends a Node, Bun, Deno or Workers app's events, crawler visits, 404s, errors and response times, with middleware for Express, Fastify and Hono.
- Next.js The @mettr/next package adds the browser script, serves it from your own domain, and sends crawler visits, 404s, errors and your events from the App Router.
- Python The mettr package sends a Django, FastAPI, Starlette or Flask app's events, crawler visits, 404s, errors and response times, with no dependencies.
- Ruby The mettr gem sends a Rails or Rack app's events, sign-ins, crawler visits, 404s, errors and response times, with no dependencies.
- Go The mettr-go module sends a Go app's events, crawler visits, 404s, panics and response times, with middleware for net/http, chi, Gin and Echo and the standard library only.
Platforms
- WordPress The mettr plugin sends a WordPress site's page views, crawler visits, 404s, fatal errors, sign-ins and WooCommerce orders, refunds and subscriptions.
- Statamic The mettr/statamic addon sends a Statamic site's page views, form submissions, sign-ups, crawler visits, 404s and errors, and leaves the control panel out.
- Shopify The mettr app for Shopify sends a store's live traffic, products viewed, carts and checkouts, and every paid order and refund, with no code and no access to customers.
- Cloudflare Worker The @mettr/cloudflare Worker sends crawler visits, 404s and response times of any site behind Cloudflare and adds the script to its pages, with no change to the site.
API
- API overview mettr's HTTP API: the keys, the endpoints for events, history, subscriptions and annotations, the limits, and what each error means.
- Events API POST /api/v1/events takes page views, your product's events, errors, payments and crawler visits, one at a time or a hundred in a batch, live.
- Import API POST /api/v1/import brings in your history from before mettr, a thousand events a batch, each with its own id so a second run adds nothing twice.
- Subscriptions API POST /api/v1/subscriptions gives mettr your own billing's subscriptions, for MRR, ARR, churn and revenue by source when you do not bill through Stripe, Paddle or Polar.
- Annotations API POST /api/v1/annotations marks a change under the traffic chart from a deploy script or CI, so a rise or a fall has its reason beside it.
Connections
- Revenue Connect Stripe, Paddle or Polar with a read-only key, or send your own billing's subscriptions, and see MRR, ARR, churn and the traffic source of each paying customer beside your visits.
- Search Console Connect Google Search Console to see clicks, impressions, CTR, position, top queries, top pages beside the visits mettr saw land from Google, and milestones of clicks.
- Import history from other tools Bring your history from Google Analytics 4, Plausible, Simple Analytics, Umami, Matomo or GoatCounter into mettr, so your charts do not start the day you switched. On the queue, on every plan.
- Export your data Take a site's events, the days imported from other tools and its labels out of mettr as a zip, on every plan, within the plan's history. What each file holds, field by field.
- Packages Follow packages on Packagist, npm, PyPI and crates.io to see their downloads, the versions and runtimes in use and every release beside your traffic.
- GitHub Follow GitHub repositories to see their stars, forks and releases beside your traffic, every star, issue and pull request in the feed through a webhook, and their traffic through mettr's GitHub App.
- Deploys Mark each deploy under the traffic chart, from GitHub, GitLab or Bitbucket's own webhooks or one request from any CI, so a drop sits next to the commit that caused it.
Using mettr
- The dashboard Tiles, the traffic chart, the live feed and map, sources and pages, filters and time ranges, your own panels, and layouts you arrange and share.
- Labels Name events by what their props say: a run with errors becomes Validation failed, drawn your way in the feed and counted as an event of its own.
- Alerts and reports Hear when nobody is online, 404s spike or sign-ups stop, in the bell, by email, Telegram, Slack or a signed webhook, and get a weekly or monthly report of each site.
- Notifications The bell lists what happened in every team you are in. Choose for each kind of notification whether it reaches the bell, email, your own Telegram, Slack or a signed webhook.
- TV mode Put your dashboards on an office TV with a code, like a streaming app: nobody signs in on the TV, and it shows only the sites you picked.
Assistants and apps
- MCP server Connect Claude, ChatGPT, Cursor or any MCP client to mettr, and ask about your sites in plain words: who is online, what changed, which sources convert.
- MCP analytics Count the calls AI assistants make to your own MCP server: which tools, from Claude, ChatGPT or Cursor, how they ended and how long they took.
- Widget API Read your sites' numbers from a phone widget, a Stream Deck, a status bar or a script, with a personal read token or OAuth, in four views ready to draw.
Account
- Teams and roles Sites belong to teams. Invite people as admins, members or guests, keep them to some of the sites, switch between teams, and keep each team's sites, channels and billing apart.
- Plans and limits What each plan includes, how Pro and Business are priced by events, how the month's events are counted, what happens when a month runs over, how much history each plan shows, and how upgrades, downgrades and refunds work.
- Privacy and your data What mettr keeps about your visitors and what it never does, whether you need a cookie banner, how to keep personal data out of events, and how to export or delete your data.
Updated · This page as Markdown · Something unclear? [email protected]