dash.tinyanalytics.io, while keeping the same cookieless collection and dashboard.
The recommended setup maps one prefix such as /stats to TinyAnalytics and loads the tracking
script from that prefix:
/stats, preserve the remaining path, method, headers, and body, and pass
the visitor’s real IP address. TinyAnalytics uses the IP address and user agent in memory to derive
its one-way cookieless visitor ID; it does not write the raw IP address to analytics data.
Prerequisites
- A site with the TinyAnalytics tracking script.
- Access to your hosting platform’s rewrite or reverse-proxy configuration.
- A path prefix on the tracked domain. Use a neutral prefix such as
/stats,/ping, or/tel; filter lists can block obvious names such as/analytics.
Configure the proxy
1
Choose a prefix and forwarding rule
Forward every request under your prefix to the same path at
https://dash.tinyanalytics.io, after removing the prefix. Keep the wildcard scoped to that
prefix rather than forwarding your whole domain.For example, /stats/script.js must reach /script.js, and /stats/api/track must reach
/api/track.2
Add the rule on your hosting platform
Choose the configuration that matches where your site runs.
- Next.js
- Vercel
- Netlify
- Nginx
- Caddy
- Cloudflare Workers
- Another proxy
Add a rewrite in On a managed host, continue to the visitor-IP step below. If you run Next.js behind your
own Nginx or Caddy server, proxy there instead so the visitor header is explicit.
next.config.js, next.config.mjs, or next.config.ts:3
Preserve the visitor address
Prefer setting
X-Real-IP to the address your hosting edge or reverse proxy verified. This
keeps cookieless visitor counts, location, device context, and bot detection tied to the
visitor rather than your proxy server.If your platform can only preserve the visitor as the first X-Forwarded-For entry, open
Settings → Exclusions for the site and turn on First-party proxy. That setting makes
TinyAnalytics prefer the first forwarded address over the address of its own Cloudflare edge.4
Generate and deploy the proxied tracking script
In TinyAnalytics, open Settings → Tracking and enter the full prefix URL in Custom Domain
(Proxy), for example The tracker derives
https://yourdomain.com/stats. Copy the regenerated tag and replace the
existing tracking script on your site:https://yourdomain.com/stats from its own src, so pageviews and other
browser requests use the same prefix automatically. The dashboard field composes the tag; the
deployed tag is the configuration, so publish your site after you copy it.What does the proxy forward?
A prefix-wide wildcard keeps the setup current as you enable optional tracker features. These are the current browser-facing paths:
You do not need to list these paths separately when your
/stats/* rule strips the prefix and
forwards the remaining path unchanged. Preserve OPTIONS requests and upstream response headers if
you use a subdomain instead of a same-origin path.
Allow the proxied paths in a Content-Security-Policy
If your site sends aContent-Security-Policy, the browser must be allowed to load tracker
scripts from your prefix and to send analytics requests to it. Two directives matter:
script-srccoversscript.jsand the lazy feature scripts the tracker loads from the same host — including the session replay recorder/script-replay.js.connect-srccovers the tracker’sPOSTrequests —/api/track,/api/heatmap,/api/replay, and the other API paths in the table above.
/stats, 'self' covers both directives:
https://dash.tinyanalytics.io. A policy
that only allows the script host but not the connect host loads the tracker and then silently
drops every event — and blocks replay uploads — so always update both together.
Use split delivery with data-api-host
The full proxy above is recommended because TinyAnalytics updates the tracking script without any
work on your side. If you intentionally keep a copy of script.js in your own static assets, set
data-api-host so events and lazy feature scripts still use your proxy:
data-api-host at runtime.
Troubleshooting
Verify the proxy
1
Check the tracking script route
Confirm the proxied script returns JavaScript:Expect
200 and a JavaScript Content-Type.2
Observe a browser event
Open your deployed site with browser developer tools, filter the Network panel by
/stats, and
navigate once. script.js should return 200, and the browser’s /stats/api/track request
should return 204. A 404, 405, or HTML response means the proxy did not preserve the path
or method. If you use heatmaps, surveys, flags, or Web Vitals, their optional requests should
use the same prefix.3
Verify attribution
Open Realtime analytics. Your visit should appear within seconds with
your network’s location rather than the proxy server’s location. Repeat from another network
if you need to confirm that visitor identity is not collapsing onto the proxy address.
The proxy is working when the tracking script loads from your domain, real events return
204
through the prefix, and Realtime shows the visitor’s location rather than the proxy’s.Related
Install the tracking script
Add the standard tag before switching its source to your proxy.
Configure the tracking script
Use
data-api-host and the other supported script attributes.Exclude traffic
Understand the First-party proxy IP-precedence setting.
Verify your setup
Diagnose a missing pageview or event.