Tunnel ID configured: ee61dcff-6f91-4caf-aa61-7ccde65a1ce4 → Cloudflare hostname ee61dcff-6f91-4caf-aa61-7ccde65a1ce4.cfargotunnel.com.
Operator setup (one-time, you do this once for the whole system)
- Sign in to Cloudflare Zero Trust → Networks → Tunnels.
- Create a new tunnel (any name, e.g.
email-tracking). Cloudflare gives you a Tunnel ID (UUID) and an install command.
- On the server running this Flask app, install
cloudflared and run the install command Cloudflare gave you. The tunnel will show up as Healthy in the dashboard.
- Inside the tunnel, add a Public Hostname:
- Subdomain:
track
- Domain: any zone you control on Cloudflare (e.g.
iprecious.co.uk) — this is the operator's tracking root
- Service:
HTTP → http://localhost:WEBHOOK_PORT (whatever port this Flask app runs on)
- Copy the Tunnel ID into the server's
env file as CLOUDFLARE_TUNNEL_ID=<uuid> and restart Flask. The "TUNNEL NOT CONFIGURED" placeholder above will then auto-fill.
After this, every client can point their track.<clientdomain> CNAME at the same <tunnel_id>.cfargotunnel.com. Cloudflare routes by Host header.
Client setup (each new company, send these to the customer)
- Log into your DNS provider (Cloudflare, GoDaddy, Namecheap, etc.) and go to DNS for your domain.
- Add this CNAME record:
Type: CNAME
Name: track
Target: ee61dcff-6f91-4caf-aa61-7ccde65a1ce4.cfargotunnel.com
TTL: Auto (or 5 minutes)
- If your DNS is on Cloudflare: leave the orange proxy cloud ON. Tunnels need it.
If your DNS is somewhere else (GoDaddy, Namecheap, Route 53, etc.): just add the CNAME — nothing else to do. Cloudflare picks up traffic by Host header through the tunnel.
- Wait 1–5 minutes for DNS to propagate. Verify with:
dig +short track.<yourdomain>
# expect: ee61dcff-6f91-4caf-aa61-7ccde65a1ce4.cfargotunnel.com.
- SSL is handled automatically by Cloudflare — no certificates to install on your end.
- Enter the full URL above (e.g.
https://track.<yourdomain>) into the Tracking base URL field at the top.
Worked example for acmeplumbing.co.uk:
DNS record: CNAME → track → ee61dcff-6f91-4caf-aa61-7ccde65a1ce4.cfargotunnel.com
Result URL: https://track.acmeplumbing.co.uk ← enter this above
Required before going live. Without a working tracking URL, unsubscribe links can't be generated and the system blocks all outgoing emails for this company.