Proxy guides

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.

Prefer the managed proxy

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" },
    ];
  },
};

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