Skip to content

AI traffic: Cloudflare

This connection works today. The other screens show what the engines say; the AI Traffic screen shows what the bots did: which page they fetched, how many times, and what your server answered. A page that returns 404 to PerplexityBot cannot be cited, no matter how good the content is.

There are two routes. Logpush is Cloudflare’s own batch delivery: no extra cost, and it works in hourly batches. A Worker catches the request as it happens, and it is the only option when the Logpush menu does not appear on your plan.

  • The Radar Pro or Custom plan in Zeo Radar. Log upload and the ingest token unlock with those plans.
  • Your domain served through Cloudflare, plus admin access to the dashboard.
  • An ingest token, generated with the “Connect a continuous stream” button on the AI Traffic screen in the app. The token represents your brand, so keep it secret; generating a new one invalidates the old one.
  1. In the Cloudflare dashboard, select your domain and go to Analytics & Logs > Logpush.
  2. Choose Create a Logpush job, with HTTP destination as the target.
  3. Paste the address below as the endpoint, with your token in it. The trailing parameter matters: Cloudflare sends the batch as gzipped bytes, and without that header the batch is mistaken for text and cannot be read.
https://app.zeoradar.com/api/bot-logs?token=YOUR_INGEST_TOKEN&header_Content-Type=application%2Foctet-stream
  1. Set the dataset to HTTP requests. Under Send the following fields, these six fields are enough:
ClientIP
ClientRequestHost
ClientRequestURI
ClientRequestUserAgent
EdgeResponseStatus
EdgeStartTimestamp
  1. Choose Submit. Before it saves the job, Cloudflare tests the endpoint with a gzipped trial batch; if the job saves, the connection is working.

The Worker below passes the request through, returns the response without holding it up, and sends only the AI bot lines to Zeo Radar. Define ZEO_RADAR_URL, including your token, as a secret variable.

const AI_BOTS = /(OAI-SearchBot|ChatGPT-User|PerplexityBot|Perplexity-User|Claude-SearchBot|Claude-User|GPTBot|ClaudeBot|anthropic-ai|Google-Extended|CCBot|Bytespider|meta-externalagent|meta-webindexer|meta-externalfetcher|Applebot-Extended|Applebot|Diffbot|Timpibot|Googlebot|Bingbot|Amazonbot)/;
export default {
async fetch(request, env, ctx) {
const response = await fetch(request);
const ua = request.headers.get("user-agent") || "";
if (env.ZEO_RADAR_URL && AI_BOTS.test(ua)) {
const row = {
ts: new Date().toISOString(),
ua: ua,
path: new URL(request.url).pathname,
status: response.status,
ip: request.headers.get("cf-connecting-ip") || null
};
ctx.waitUntil(
fetch(env.ZEO_RADAR_URL, {
method: "POST",
headers: { "Content-Type": "application/x-ndjson" },
body: JSON.stringify(row) + "\n"
}).catch(() => {})
);
}
return response;
}
};
  1. Create a Worker with npx wrangler init zeo-radar-bot-logs and put the code in src/index.js.
  2. Run npx wrangler secret put ZEO_RADAR_URL and enter the full address including the token.
  3. Publish it with npx wrangler deploy, then point the Worker at your domain in the dashboard.

Open the AI Traffic screen in the app. With Logpush traffic appears within an hour, with a Worker within a few minutes. You can also trigger it yourself:

Terminal window
curl -A "PerplexityBot/1.0" https://yourdomain.com/ -o /dev/null -s

The Bot requests counter on screen should go up, and a PerplexityBot row should appear in the table.

SymptomCauseFix
The Logpush job will not save, “error validating destination”The address is missing the header_Content-Type parameterPaste the address exactly as shown in step 3
The job saved but no data arrivesA field is missing, the user agent is not being sentTick the ClientRequestUserAgent field
Response 401 “Unknown ingest token”The token is wrong, or a new one has been generatedGet a new token from the app and update the address
The Worker is live but the counter does not moveZEO_RADAR_URL is undefined, or there is no Worker routeCheck the secret variable and the route match
There is no Logpush menu in the dashboardYour Cloudflare plan does not include LogpushUse the Worker route
A high number in the unverified columnThe bot name arrives from an address the vendor never publishedThat means a fake bot, block it at the network layer rather than in robots.txt

feedback.question