Skip to content
metryo

14Reference

Collect API: the endpoint behind the script

The script sends a tiny JSON payload to POST /api/collect. You can also call it directly from native apps or server-side code.

FieldTypeDescription
sstringYour site ID, e.g. site_k3v9x2m4q1 (required)
ustringFull page URL, including query string (required)
rstringdocument.referrer, may be empty
w / hnumberScreen width and height in pixels
estring?Custom event name — omit for a pageview
pobject?Event properties (strings, numbers, booleans)
tstring?"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.