Multi-domain & environments
One Site in Lightweight Analytics can track multiple hostnames – for example a docs sub-domain or separate staging URL (the root domain you setup initialy and its www-variant are handled for you).
Add / remove domains
- Open Site → Domains from the sidebar.
- Enter a host or wildcard (
*.example.com
). - Tick Wildcard if you want to match any sub-domain.
- Save – domain appears in the list with a delete button.
Up to 20 aliases per site are allowed.
Multiple domain aliases
Production vs Non-production traffic
By default any hostname not on the list is treated as non-production. For
example localhost
, 127.0.0.1
or your staging domain. Development hits are
still stored but they live in a separate segment so they don’t pollute your
real metrics.
On the dashboard header you’ll see a Production / Non-production toggle to switch views. The All-Sites grid also shows a tiny “Dev” badge when the latest traffic came from a non-prod domain.
Local dev tip
Append?env=dev
to the script URL or set headerla-env: dev
in your requests to force events into the non-production queue even on production hostnames.
Validation
An orange Validate button on the site card checks if we have seen data. Once the first hit arrives the badge turns green Connected.