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 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 is one for Laravel, one for plain PHP, and the Events API for any other language.
- Connections bring in what other services know: revenue from Stripe, Paddle or your own billing, Search Console from Google, and deploys from GitHub, GitLab, Bitbucket or any CI.
- History from before mettr goes in through the Import API.
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, 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 and who is online, with no cookies.
- 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.
- JavaScript The @mettr/browser package loads the browser script from your bundle and sends your product's events, safely during server rendering.
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 or Paddle.
- 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 or Paddle 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 and top pages beside the visits mettr saw land from Google.
- 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.
- Alerts and reports Hear when nobody is online, 404s spike or sign-ups stop, by email, Telegram, Slack or a signed webhook, and get a weekly or monthly report of each site.
- 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.
- 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 or members, switch between teams, and keep each team's sites, channels and billing apart.
- Plans and limits What each plan includes, how the month's events are counted, what happens past the limit, 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]