Sensor docs
Track AI traffic with Cloudflare Workers
The edge Worker records recognized AI crawler requests and recognized AI answer referrals before traffic reaches your origin. It uses a hostname-bound public workspace identifier, never a secret API key.
1. Deploy the Worker
The one-click template creates an isolated Worker project and asks for your publishable workspace identifier. Cloudflare cannot infer your production hostname, so you will attach the route in step 3.
Deploy to CloudflarePrefer the CLI? Start a Worker project and install the published adapter:
npm install @foglift/tracker@^1.4.02. Add the generated Worker
Open AI Traffic while signed in to copy this entrypoint with your workspace identifier filled in. The adapter reports a matched request and passes the original request through to your origin unchanged.
// src/worker.ts
import { trackAITrafficWorker } from "@foglift/tracker/cloudflare";
export default {
fetch: trackAITrafficWorker({
siteToken: "YOUR_WORKSPACE_ID",
}),
};Matched reports stay alive through ctx.waitUntil, so Foglift reporting does not delay the response.
3. Assign the route safely
Use this path only when you control an active, proxied Cloudflare zone. Configure the Worker route for your hostname, such as example.com/*. Do not replace an existing Worker route or overwrite its bindings, compatibility settings, or fetch behavior. If a Worker already owns that route, review the integration before deployment.
npx wrangler dev
npx wrangler deploy4. Verify the server signal
- Confirm the Worker route is active on the intended production hostname.
- Open AI Traffic and keep the page listening.
- Request a routed page with a recognized AI-crawler user agent. Foglift confirms the first server-observed event.
The Sensor sends the matched agent role, request path, and referrer hostname only. Query strings, request bodies, cookies, and page content are not reported. Cloudflare security products can block traffic before a Worker runs, so this covers recognized requests that reach the Worker. A crawler request does not prove indexing or citation.
Open AI Traffic