Proxy the script through your own server
Forward /js/script.js and /api/event with nginx, Caddy, Next.js rewrites or Express, and the location and rate-limit trade-offs the managed proxy avoids.
You can also forward two paths of your own website to SuprAnalytics: /js/script.js (the script) and /api/event (where it sends events). The script sends events to the host it was loaded from, so once both are forwarded, nothing else changes.
Through your own proxy, SuprAnalytics sees your proxy's address for every visitor, not the visitor's. Locations fall back to the browser's timezone (country only), and the per-IP rate limit (120 hits a minute) applies to all your traffic together, so a busy website gets 429s. Cookieless mode also can't tell visitors apart. The managed proxy has none of these problems.
// next.config.js
module.exports = {
async rewrites() {
return [
{ source: "/js/script.js", destination: "https://supranalytics.app/js/script.js" },
{ source: "/api/event", destination: "https://supranalytics.app/api/event" },
];
},
};location = /js/script.js {
proxy_pass https://supranalytics.app/js/script.js;
proxy_set_header Host supranalytics.app;
proxy_ssl_server_name on;
}
location = /api/event {
proxy_pass https://supranalytics.app/api/event;
proxy_set_header Host supranalytics.app;
proxy_ssl_server_name on;
}yourdomain.com {
handle /js/script.js {
reverse_proxy https://supranalytics.app {
header_up Host {upstream_hostport}
}
}
handle /api/event {
reverse_proxy https://supranalytics.app {
header_up Host {upstream_hostport}
}
}
# … the rest of your site
}// npm install http-proxy-middleware
const { createProxyMiddleware } = require("http-proxy-middleware");
app.use(
createProxyMiddleware({
target: "https://supranalytics.app",
changeOrigin: true,
pathFilter: ["/js/script.js", "/api/event"],
}),
);Then load the script from your own domain:
<script defer supr-website-id="YOUR_WEBSITE_ID" supr-domain="yourdomain.com" src="/js/script.js"></script>
If /api/event is taken on your website, forward another path and point the script at it with supr-api="/your/path".
Live chat
With live chat on, the chat widget still loads from SuprAnalytics's own address (/js/chat.js), not through your proxy.
AI agent or LLM? Read this page as Markdown