Docs
First-party proxy
Host the snippet and collect on the origin you measure. Zarstat does not sell a managed proxy. localStorage visitor_id is still per origin and does not cross subdomains.
Markdown · same page for crawlers. index, follow.
Why
A script loaded from www.zarstat.co.za is third-party on your shop. Some blockers drop it. Serving /cashline.js and posting to /api/collect on your host keeps the request first-party for that origin only.
Next.js rewrite
In next.config — docs only. Point at your Zarstat deploy.
async rewrites() {
return [
{ source: "/cashline.js", destination: "https://www.zarstat.co.za/cashline.js" },
{ source: "/api/collect", destination: "https://www.zarstat.co.za/api/collect" },
];
}Then load <script src="/cashline.js" data-site="YOUR_SITE">. The snippet posts to the script origin, so collect stays on you.
nginx
location = /cashline.js {
proxy_pass https://www.zarstat.co.za/cashline.js;
}
location = /api/collect {
proxy_pass https://www.zarstat.co.za/api/collect;
proxy_set_header Host www.zarstat.co.za;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}Honest limit
localStorage.cashline_vid does not follow the rewrite. www and app stay different visitors. See hostnames and CSP.