01Install guide
Add Metryo to any website
One script tag before the closing </head> tag. Works on plain HTML, static site generators and any CMS that lets you edit the page head.
- 01
Create the website in your dashboard
Choose Add website and enter its name and domain, without https://. You get a site ID that looks like site_k3v9x2m4q1. To try it on your own machine first, register localhost:3000 as the domain.
- 02
Add the snippet
index.htmlReplace site_xxxxx with your own site ID — everything else is copied as it is.
- 03
Open your site
Load any page of your site in a browser. The dashboard's install screen checks every few seconds and unlocks the moment the first pageview arrives.
Where the tag goes
Inside <head>, on every page you want counted. With a static site generator or a CMS, that means the shared head template or partial — the one file every page is built from — so a new page is measured without anyone remembering to add it.
defer keeps the script from holding up the page: it downloads alongside your HTML and runs once the document has been parsed.
It has to be a real script tag
The script reads its own tag to find your site ID. Importing the file through a bundler, or pasting its contents inline, leaves it with nothing to read and it stops without an error. Keep it as a <script src> tag.
Pasted it but nothing arrives?
- An extension is blocking it. Ad blockers and privacy extensions drop analytics requests. Check in a private window with extensions disabled.
- It is running on a different domain. A snippet only accepts events from the domain its website was registered with, and that domain's subdomains, so nobody else can send data in your name. Add a separate website for any other domain.
- You muted yourself earlier. Setting metryo_ignore in localStorage silences the script in that browser. Remove the key to start sending again.
- The monthly allowance ran out. Once an account passes its plan's allowance, new events stop being recorded until the next month. The allowance is shared across all of an account's websites.
Next: send custom events, turn on click tracking, or see every option the tag accepts.