01Quick start
Install Metryo in minutes.
Create a website in your dashboard, copy your snippet, and paste it before the closing </head> tag. Data appears within seconds of the first visit.
Replace site_xxxxx with the site ID from your dashboard — everything else is copied as-is.
02Custom events
Track the actions that matter.
Pageviews are automatic on every plan. For everything else — signups, purchases, downloads — call metryo.event() from anywhere in your code. Available on all plans, including Free.
From JavaScript
From HTML
Single-page apps
03Click tracking · Paid plans
Measure clicks without writing code.
On any paid plan the script also records clicks on its own. Mark an element with data-metryo-event and it is tracked by name; outbound links and file downloads are detected with no markup at all.
Click tracking is available from the Starter plan upwards. On the Free plan these events are discarded and never count towards your monthly allowance — metryo.event() keeps working on every plan.
Naming a click
Detected automatically
- Outbound link — any link to a different hostname, with the destination domain, full URL and link text as properties.
- File download — links ending in a document, archive, installer or media extension, with the file name attached.
- In-page anchors and mailto: or tel: links are skipped, so they never consume your allowance.
Turning detection off
04Reference
The collect endpoint.
The script sends a tiny JSON payload to POST /api/collect. You can also call it directly from native apps or server-side code.
| Field | Type | Description |
|---|---|---|
| s | string | Your site ID, e.g. site_k3v9x2m4q1 (required) |
| u | string | Full page URL, including query string (required) |
| r | string | document.referrer, may be empty |
| w / h | number | Screen width and height in pixels |
| e | string? | Custom event name — omit for a pageview |
| p | object? | Event properties (strings, numbers, booleans) |
| t | string? | "click" for auto-tracked clicks — requires a paid plan |
The endpoint always answers 202 so analytics can never break your page. Device, browser, country and traffic-quality signals are derived server-side; the visitor identifier is a salted hash that rotates monthly — no cookies, no raw IP stored.