Skip to main content
This guide explains how to deploy a Cloudflare Worker on your own zone that captures HTTP request data, classifies AI-related traffic, and forwards it to Citable’s ingest pipeline. The Worker runs as middleware — it does not replace your origin; it logs telemetry and passes the request through.
Looking for a fully managed setup where Citable runs the Workers? See AI Traffic Proxy (Managed) — available to trusted partners; contact us to enable.

Overview

The integration uses a Cloudflare Worker on your Cloudflare account. For each request the Worker:
  1. Forwards the request to your origin (fail-open)
  2. Extracts signals (user agent, referrer, path, bot score)
  3. Classifies traffic (crawler, AI referral, agent, human)
  4. POSTs high-signal events to https://ingest.getcitable.com
Events flow through Citable’s queue into ClickHouse and appear in Agent Analytics alongside managed-proxy traffic.

Before you start — provision credentials in Connectors

You need a site ID and ingest auth token registered on Citable’s side before your Worker can send data. Self-serve this from the Citable app — no need to email us for credentials.

Step 1 — Create credentials in Connectors

  1. Open Settings → Connectors in Citable.
  2. Find AI Traffic Proxy and click Connect.
  3. Choose Self-hosted Cloudflare Worker (not the managed CNAME proxy).
  4. Enter your site ID — the hostname your Worker will run on (e.g. www.example.com). This becomes the partition key for your traffic in Agent Analytics.
  5. Click Create credentials.
Citable registers token:{your-token}siteId in our infrastructure and shows you:
Copy the ingest token when it is shown — it is displayed once for security. If you lose it, disconnect and recreate credentials in Connectors, or use Regenerate token when available.
Looking for Citable to run the Workers for you? That is the managed proxy path for trusted partners — contact us to enable it.
Need help choosing routes, reviewing your Worker, or debugging ingest errors? Contact us — we are happy to assist even though credential setup is self-serve.

Prerequisites

  • A Cloudflare account with Workers enabled on the zone you want to instrument
  • Node.js on your development machine
  • Access to your domain’s Cloudflare DNS / Workers configuration
  • A Citable ingest token from us (see above)
  • A Citable account with Connectors access (to self-provision ingest credentials)
Using Cloudflare Enterprise with Logpush? Contact us — we can discuss alternative ingestion paths.

Implementation guide

Set up your development environment

Create a new Worker project:
When prompted:
  • Template: Hello World
  • Language: TypeScript
  • Deploy now: optional (you can deploy after configuring)

Configure your Worker

Edit wrangler.toml (or wrangler.json). Replace the route pattern and zone with your site:
Use the hostname shoppers and bots actually visit (e.g. www.example.com/*), not your internal origin. If unsure about route patterns, contact Citable before deploying.
Copy this TypeScript into src/index.ts:
This example uses simplified classification. Citable’s managed proxy uses a fuller bot registry and behavioral signals — contact us if you need parity.

Deploy your Worker

Test your implementation

  1. Visit your site through the routed hostname (e.g. https://www.example.com).
  2. Optionally simulate a crawler: curl -A "GPTBot/1.0" https://www.example.com/
  3. Open Agent Analytics (/ai-traffic) → Edge Traffic. Allow a few minutes for data to appear.
Direct ingest smoke test (optional):
Expect 200 OK.

Troubleshooting

Security considerations

  • Store CITABLE_INGEST_TOKEN as a Wrangler secret, not a [vars] plain-text value
  • Rotate tokens from Connectors (disconnect + recreate, or Regenerate when available) — old KV entries are revoked
  • Monitor Worker invocations for unusual volume or error rates
  • The ingest endpoint is not a public API — treat the token like an API key

Need help?