Embedding Peepmetrics
Add analytics to any site in under a minute.
1. Add your domain
Sign in and go to My Domains.
Click Add domain, enter your hostname (e.g. example.com), and save.
A unique tracking token will be generated for you.
2. Embed the snippet
Copy the snippet shown on your domain's page and paste it into the
<head>
of every page you want to track.
It looks like this:
<script
defer
src="https://peepmetrics.io/t.js"
data-token="YOUR_TRACKING_TOKEN"
></script>
Replace YOUR_TRACKING_TOKEN with the token shown in your dashboard.
3. That's it
Once the snippet is live, page views will appear in your dashboard in real time. No cookies, no consent banner, no configuration needed.
How it works
When a visitor loads your page, the t.js
snippet reads the current path and referrer, then fires a single background request to
POST /api/track
using navigator.sendBeacon.
The request never blocks page load and never sets a cookie.
The server resolves the visitor's approximate country from their IP address and detects their browser from the user-agent string. The IP itself is never stored.
For single-page applications, the snippet automatically hooks into
history.pushState
and the popstate
event, so client-side route changes are tracked without any extra setup.
Privacy approach
Peepmetrics is built on a simple principle: measure aggregate behavior, not individual people.
- No cookies or local storage are used for tracking.
- No fingerprinting or cross-site data sharing.
- IP addresses are used only to resolve a country code and are never persisted.
- Raw event data is automatically rolled up and pruned after 7 days.
- There is nothing to declare in a cookie notice or privacy policy for standard tracking.
Check your local legal requirements — while Peepmetrics is designed to be GDPR-friendly, this is not legal advice.