Proxy Admaxxer Through Netlify Redirects

Netlify's redirect engine supports a 200 status code that acts as a transparent proxy — the browser sees your domain but Netlify fetches the content from the upstream URL. This is the fastest way to route the Admaxxer pixel through your Netlify site without any build plugins or serverless functions.

Why Proxy?

Prerequisites

Option A — Using _redirects File

Add these two lines to public/_redirects (or wherever your build output root is):

/js/script.js         https://admaxxer.com/js/script.js         200
/api/event/*          https://admaxxer.com/api/event/:splat      200

The 200 status tells Netlify this is a rewrite (proxy), not a redirect. The :splat token forwards path segments after /api/event/.

Option B — Using netlify.toml

If you prefer the TOML configuration file, add to netlify.toml in your project root:

[[redirects]]
  from   = "/js/script.js"
  to     = "https://admaxxer.com/js/script.js"
  status = 200
  force  = true

[[redirects]]
  from   = "/api/event/*"
  to     = "https://admaxxer.com/api/event/:splat"
  status = 200
  force  = true

Use force = true if there is an existing file at that path in your publish directory — otherwise Netlify serves the file instead of proxying.

Step 2 — Deploy

git add _redirects    # or netlify.toml
git commit -m "proxy admaxxer pixel on own domain"
git push

Netlify redeploys automatically on push. The proxy rules take effect immediately after the deploy completes.

Step 3 — Update the Admaxxer Snippet

In Admaxxer go to Connections › Install, enable Custom proxy domain, enter your Netlify domain, and copy the regenerated snippet.

Step 4 — Test

curl -I https://yourdomain.com/js/script.js
# Expect: HTTP/2 200  content-type: application/javascript

curl -X POST https://yourdomain.com/api/event \
  -H 'Content-Type: application/json' \
  -d '{"name":"pageview","url":"https://yourdomain.com/"}'
# Expect: HTTP/2 200 or 204

Troubleshooting

Rollback

Delete the two lines from _redirects (or the two [[redirects]] blocks from netlify.toml), then push. Disable the custom proxy domain in Admaxxer to revert the snippet.

Other Proxy Guides

Cloudflare · Vercel · Next.js · Nuxt · WordPress · Apache · NGINX

See also: Connections › Install for the base snippet.