Cloudflare Worker

    Agent Analytics can ingest HTTP request metadata from your site through a Cloudflare Worker that runs as lightweight middleware. The Worker forwards request and response summary data to GeoGenie's access-log API so you can see AI bot activity alongside your other GeoGenie metrics — without changing how your origin serves traffic.


    How it works

    For each request, the Worker passes the request through to your site unchanged, then asynchronously sends a small JSON payload describing the visit: host, path, method, query parameters, client IP (from cf-connecting-ip), user agent, referer, response status, and an approximate total byte size (headers plus body). Your visitors do not wait on that forward step.

    Logs are sent to https://logs-api.geogenie.ai/cloudflare/access-logs with your site's API key in the X-API-Key header.

    Prerequisites

    • A Cloudflare account with access to Workers
    • The domain you want to measure proxied through Cloudflare (orange-cloud DNS)
    • A GeoGenie workspace with Agent Analytics bot tracking configured for that host

    Get your Worker script

    GeoGenie generates a ready-to-paste Worker for you in the console — including your API key. Open Agent Analytics bot tracking setup, add the site host, choose Cloudflare as the provider, and use Copy Worker code. That version is the one you should deploy.

    Deploy in the Cloudflare dashboard

    You can create and publish the Worker entirely in the dashboard (no command-line tools required):

    1. In Cloudflare, go to Workers & Pages and create a new Worker.
    2. Paste the script from GeoGenie (from Copy Worker code) into the editor and deploy.
    3. Attach a Route that covers the hostname you added in GeoGenie — for example www.yoursite.com/* or yoursite.com/* — using the same zone as your production site. Use the host you care about for analytics (often your marketing site).
    4. Confirm DNS records for that host are proxied through Cloudflare so the Worker can run on the edge.

    After traffic flows through the Worker, GeoGenie will start receiving events. Use the verification tools in Agent Analytics in the console to confirm logs are arriving.

    Troubleshooting

    • Verify the route pattern matches the hostname you registered in GeoGenie and that requests to that host are orange-cloud proxied.
    • Confirm the API key in X-API-Key matches the key shown for that host in the console.
    • Check Workers & Pages metrics and logs in Cloudflare for execution errors.
    • Generate a bit of traffic on the site after deploy, then run the log check in the console again.