04Install guide
Add Metryo to WordPress
A few lines in your theme's functions.php print the script on every page. No plugin to install or keep updated.
- 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
functions.phpReplace 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.
Use a child theme
A theme update replaces functions.php, and the hook with it. Put the snippet in a child theme's functions.php instead. If your theme has a field for header scripts, pasting the plain HTML tag there does the same job.
Keep your own visits out
Editing and previewing your site counts as traffic like any other visit. To exclude a browser, set one key in it:
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.