Web tracker SDK
The Tracera web tracker is a single tiny script with one job: collect what's happening on your site without leaking anything about who's doing it.
Install
<script defer
src="https://tracera.eu/t.js"
data-pk="pk_a3f09c2e71bd">
</script>
Place it once, anywhere in the HTML document. defer guarantees it runs after parsing and never blocks rendering.
Configuration attributes
| Attribute | Default | Purpose |
|---|---|---|
| data-pk | — | Required. Your property's public ingest key. |
| data-endpoint | https://tracera.eu | Override for self-hosted or first-party-proxy setups. |
The global function
After the tracker loads, a global tracera() function is available:
tracera('event', 'signup_completed', { plan: 'pro', value: 49 });
tracera('pageview'); // manual pageview (rare)
tracera('pageview', '/virtual/onboard-step-2'); // virtual path
Call it from anywhere once the script has loaded.
Self-hosting
For ad-blocker resistance and zero third-party hits, serve the tracker from your own domain:
- Download t.js and host it at a path of your choice, e.g.
https://yourapp.com/_t/t.js. - Proxy the ingest endpoint from your origin. Any reverse proxy works:
# Caddy yourapp.com { reverse_proxy /_t/i* https://tracera.eu { header_up Host tracera.eu } } - Point the tracker at your proxy:
<script defer src="/_t/t.js" data-pk="pk_..." data-endpoint="/_t/i"></script>
What gets sent
Per pageview the tracker emits one POST to the ingest endpoint with a body like:
{
"p": "pk_a3f09c2e71bd",
"t": "pageview",
"u": "https://app.example.com/dashboard?id=42",
"r": "https://app.example.com/",
"w": 1920,
"h": 1080,
"ts": 1730000000
}
Note what is not there: no cookie, no device ID, no IP (the server sees your IP via the TCP connection but never writes it), no fingerprint hash, no list of installed fonts.
Privacy in detail
- Zero browser storage. No cookies, no localStorage, no sessionStorage, no IndexedDB.
- No identifier sent. The server derives a 24-hour-rotating hash from
(daily_salt, domain, ip, user-agent)and stores that hash. The raw IP is discarded immediately.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| No events at all | Bad public key, or domain not in property's allowed list | Re-check data-pk and the property's "Allowed origins" |
| SPA only logs first pageview | Route change isn't using pushState | Call tracera('pageview') manually on route change |
| Events show in dev but not prod | Content-Security-Policy is blocking the beacon | Add tracera.eu to your connect-src directive (or self-host the endpoint) |
| Ad-blocker drops some events | Common | Self-host the tracker and proxy ingest from your own (sub)domain |