Configuring AI Traffic
AI Traffic is powered by your server logs. Forward them to Gauge from one of two sources:
- Vercel — requires a Vercel Pro or Enterprise plan. Use this if you host on Vercel without Cloudflare in front.
- Cloudflare — works on any Cloudflare plan, including Free. Use this if your site is behind Cloudflare, even if the origin is hosted elsewhere.
Both live under Settings → Integrations, on the Vercel and Cloudflare cards. You can connect both.
Your Drain URL and Secret
Every setup path uses two values shown on the integration page:
- Destination URL (called Endpoint URL on the Vercel card) — where your host sends logs. Click Copy.
- Secret — authenticates those logs. Click Show, then Copy.
Vercel Setup
Open Settings → Integrations → Vercel in Gauge — you’ll copy the Endpoint URL and secret from it. The rest happens in the Vercel dashboard:
- In your Vercel team, open Settings → Drains and click Create Drain.
- Pick Logs as the data source.
- Select the projects you want to track. Under source types, enable Static Files, Function, and Edge Function — all three together capture every incoming HTTP request. Under environments, enable Production.
- For the destination, choose Custom endpoint and paste the Endpoint URL from the Gauge page. Pick either JSON or NDJSON as the format — Gauge accepts both.
- Still on the destination step, click Add header and create a header named
Authorization with the value Bearer <your-secret> — click Show on the Gauge page to reveal the secret.
- Save the drain. Vercel runs a connectivity check, and traffic starts flowing within a few minutes. In Gauge, the card shows a Receiving events badge and a View AI Traffic button once events land.
Without the Authorization header, Gauge rejects every event with a 403 and you’ll see no traffic. The value must start with Bearer followed by your secret.
Cloudflare Setup
Open Settings → Integrations → Cloudflare and pick a tab:
- Worker (any plan) — Gauge forwards traffic through a small Cloudflare Worker. Right for almost everyone.
- Logpush (Enterprise) — Cloudflare streams logs directly to Gauge. Cloudflare Enterprise only.
Option 1: Automatic Worker Setup (Recommended)
Gauge creates the Worker, uploads the secret, and attaches the routes. It needs a scoped Cloudflare API token:
- Click Connect Cloudflare.
- Click Create the token on Cloudflare. This opens Cloudflare’s Create Custom Token form pre-filled with the three permissions Gauge needs:
Account.Workers Scripts: Edit, Zone.Workers Routes: Edit, and Zone.Zone: Read.
- In Cloudflare, click Continue to summary, then Create Token, and copy the token.
- Back in Gauge, paste it into the Paste the token field and click Connect.
- If the token can access more than one Cloudflare account, pick one and click Use this account.
The card now shows a Cloudflare connected badge and lists every zone (domain) on your account under Your zones.
Enable a Zone
Click Enable on a zone. Gauge deploys the Worker with a wildcard route covering the whole zone and forwards every request.
To change what gets forwarded, expand the zone with the chevron first. Two settings:
Routes — which parts of your site the Worker watches:
- Apex (
yourdomain.com/*)
- WWW subdomain (
www.yourdomain.com/*)
- Docs subdomain (
docs.yourdomain.com/*)
- Wildcard (
*.yourdomain.com/*) — all subdomains
- Add route for a custom pattern, like
app.yourdomain.com/*
Traffic to forward:
- All requests (recommended) — forward everything; Gauge classifies bots downstream.
- Bot requests only — drop human traffic at the edge, forward only known AI crawlers (GPTBot, ClaudeBot, PerplexityBot, etc.). Only use this if your security policy requires it — filtered traffic can’t be backfilled.
Click Enable (or Update if the zone is already running).
Verify
The zone badge shows Enabled, no events yet right after deploying, then Receiving events once traffic lands — usually within a minute. If events never arrive, check that the zone’s DNS records are proxied through Cloudflare (orange cloud on). The Worker only sees proxied traffic.
Option 2: Manual Worker Setup
If you’d rather not give Gauge an API token, expand Prefer to set up manually? at the bottom of the Worker tab:
- In the Cloudflare dashboard, go to Workers & Pages → Create Application, choose Start with Hello World!, and click Deploy.
- Open the new Worker, go to Settings → Variables and Secrets, and add an encrypted Secret named
DRAIN_SECRET. For the value, click Show on the Secret row in Gauge, copy it, paste it in, and select Save Version.
- Click Edit code, replace the starter contents with the Worker code from the Gauge page (Copy Worker code button), and click Save and deploy.
- Go to Settings → Triggers → Routes and add a route matching your zone — for example,
*.yourdomain.com/*.
- Traffic starts forwarding within a minute. Gauge shows Manual setup detected with per-zone event counts once payloads arrive.
Option 3: Logpush (Cloudflare Enterprise)
- In the Cloudflare dashboard, open your zone and add a Logpush job under Analytics & Logs → Logs.
- Select dataset HTTP requests and destination HTTP.
- Paste the Destination URL from the Gauge page.
- Under Advanced options, add a header named
Authorization with the value Bearer <your-secret>.
- On the Configure fields step, select
ClientRequestUserAgent. Also recommended: EdgeStartTimestamp, ClientRequestPath, ClientRequestHost, EdgeResponseStatus, EdgeResponseBytes, and ClientCountry.
- Save the job. Cloudflare sends a test batch, and the badge in Gauge flips to Receiving events within a few minutes.
If ClientRequestUserAgent isn’t selected, the logs arrive without user agents and Gauge can’t detect AI bots.
Turning It Off
- Vercel: open Settings → Drains in Vercel, click into the drain, and select Delete drain.
- Cloudflare (automatic): click Disable on a zone, or Disconnect to drop the API token entirely.
- Cloudflare (manual or Logpush): delete the Worker route or Logpush job in the Cloudflare dashboard.
Historical data already in Gauge stays put.
Troubleshooting
- No events after Vercel setup — check the
Authorization header exists and starts with Bearer , and that Production is enabled under environments.
- No events after Cloudflare Worker setup — check the zone’s DNS records are orange-cloud proxied and the route pattern matches your traffic (including the trailing
/*).
- Traffic stopped after regenerating the secret — update the
DRAIN_SECRET in your Worker, or the Authorization header in your Logpush job or Vercel drain, with the new value.
- Bots missing from Logpush data — make sure
ClientRequestUserAgent is in the job’s field list.
Still stuck? Email [email protected].