Are you an agent? View this page in Markdown.Read our AI instructions.
  • Pricing
  • Docs
  • Blog
  • Changelog
  • Agent Picks runner on GitHub
  • AI Search
  • Visibility
  • Response accuracy
  • Brand positioning
  • AI Traffic
  • Actions
  • Results
  • Agents
  • API & MCP
  • Agent Picks
  • Pick rate
  • Agent Experience
  • Why agents leave
  • Fixes and re-tests
  • Agent runs
  • Local Runner
  • How we test
  • State of AI Search for Dev Tools
  • Developer tool AI search landscape
  • Leaderboards
Sign InSign Up

Make AI describe you the way you'd describe yourself.

Start free trial

No card required

Get recommended by AI search and coding agents.

Product

  • Results
  • How we test
  • Landscape
  • Integrations
  • AI agent directory
  • Free AI visibility checker
  • AI robots.txt checker
  • Pricing
  • FAQ
  • AI instructions

Compare

  • Compare DevTune
  • Peec AI alternatives
  • Profound alternatives
  • OtterlyAI alternatives
  • Profound vs Peec AI
  • DevTune vs Peec AI
  • DevTune vs Profound
  • DevTune vs OtterlyAI
  • DevTune vs Semrush
  • DevTune vs Ahrefs

About & resources

  • About DevTune
  • Free AI search tools
  • Blog
  • Best AI visibility tools
  • Coding agent visibility tools
  • AI visibility APIs, MCP & webhooks
  • Contact
  • Press kit

Legal

  • Terms of Service
  • Privacy Policy
  • Cookie Policy

© Copyright 2026 DevTune. All Rights Reserved. PLGeek Ltd, registered in England and Wales, company number 14492509. Registered office: C/O Aardvark Accounting, 1 Cedar Office Park, Cobham Road, Wimborne, BH21 7SB.

Are you an agent? View this page in Markdown.Read our AI instructions.
Blog

How to Track AI Crawler and Answer-Fetch Traffic in Cloudflare, Vercel and Nginx

Tell AI answer fetches, search crawls, training crawls and AI referrals apart in your server logs, with copy-paste filters for Cloudflare, Vercel log drains, Nginx and SQL, and why browser analytics miss most of it.

Dec 4, 2026·Ben WilliamsThe Product-Led Geek · CEO, DevTune
On this page+−
  1. Four kinds of AI traffic
  2. Why browser analytics miss it
  3. Filter your logs
  4. Check the requests are real
  5. Read the 404s
  6. Track referrals
  7. Do it without the log work

When ChatGPT, Claude or Perplexity answers a question about your product, it often fetches one of your pages first. That request lands in your server or CDN logs and almost never in your analytics, because the fetcher runs no JavaScript. This guide shows how to separate the four kinds of AI traffic in your logs, with filters to copy for Cloudflare, Vercel, Nginx and SQL, and how to read the requests for pages that don't exist.

Four kinds of AI traffic

Count these separately. They answer different questions, and adding them together produces a number that means nothing.

KindWhat happenedExample user agentsWhat it tells you
Answer fetchAn AI system retrieved your page to build an answer for someone, right nowChatGPT-User, Claude-User, Perplexity-User, DuckAssistBotWhich pages AI answers read about your topic
Search crawlAn AI search crawler indexed your page so it can be found and cited laterOAI-SearchBot, Claude-SearchBot, PerplexityBot, bingbotWhether AI search knows the page exists
Training crawlA crawler collected your page as possible training dataGPTBot, ClaudeBot, Bytespider, Meta-ExternalAgent, AmazonbotWhat goes into future models
AI referralA person clicked a link in an AI answer and arrived on your siteA normal browser, with a referrer such as chatgpt.comWhich answers send you visitors

Two smaller groups sit beside them:

  • Coding agents. Claude Code, Gemini CLI, Aider, OpenCode, Qwen Code and Crush fetch pages from a developer's machine while writing code, with user agents such as claude-code/ and Google-Gemini-CLI/. These are answer fetches too, and worth counting on their own if your buyers write code.
  • Acting agents. Google-Agent navigates sites and takes actions when a person asks it to.

The answer fetch is the one to watch most closely. It is the closest signal you have to "an AI answer about this topic just read this page", and it happens whether or not the answer ever sends a visitor.

The AI user-agent lookup names the crawler or agent behind any user agent or log line you paste, and puts it in one of these groups.

Why browser analytics miss it

Google Analytics, PostHog and similar tools count a visit when the page's JavaScript runs in a browser. AI fetchers request the HTML and stop. So:

  • Answer fetches and crawls never appear. The request is served and logged by your server or CDN, and no analytics script runs.
  • 404s never appear. When an AI system requests a page that doesn't exist, nothing on your site records it except the server log. These requests are demand: an answer expected a page, often with a guessed URL like /docs/webhooks or /pricing/enterprise, that you haven't published.
  • Referrals do appear, sometimes. A person clicking through from an AI answer runs your analytics script. Browsers that block your analytics script still hide some of them.

So AI traffic needs two sources: the server or CDN log for machines, and analytics for people.

Filter your logs

Each filter below matches the answer fetchers DevTune's AI Traffic counts. The user-agent lookup generates the same filters for every group, including coding agents, search crawlers and training crawlers.

Cloudflare

For a WAF custom rule, use an expression:

(lower(http.user_agent) contains "chatgpt-user") or (lower(http.user_agent) contains "claude-user") or (lower(http.user_agent) contains "claude-web") or (lower(http.user_agent) contains "perplexity-user") or (lower(http.user_agent) contains "duckassistbot") or (lower(http.user_agent) contains "google-notebooklm") or (lower(http.user_agent) contains "mistralai-user") or (lower(http.user_agent) contains "amzn-user/")

To export the raw requests, add a filter to a Logpush job on the HTTP requests dataset so it ships only matching lines:

{
  "where": {
    "or": [
      {
        "key": "ClientRequestUserAgent",
        "operator": "contains",
        "value": "ChatGPT-User"
      },
      {
        "key": "ClientRequestUserAgent",
        "operator": "contains",
        "value": "Claude-User"
      },
      {
        "key": "ClientRequestUserAgent",
        "operator": "contains",
        "value": "Claude-Web"
      },
      {
        "key": "ClientRequestUserAgent",
        "operator": "contains",
        "value": "Perplexity-User"
      },
      {
        "key": "ClientRequestUserAgent",
        "operator": "contains",
        "value": "DuckAssistBot"
      },
      {
        "key": "ClientRequestUserAgent",
        "operator": "contains",
        "value": "Google-NotebookLM"
      },
      {
        "key": "ClientRequestUserAgent",
        "operator": "contains",
        "value": "MistralAI-User"
      },
      {
        "key": "ClientRequestUserAgent",
        "operator": "contains",
        "value": "Amzn-User/"
      }
    ]
  }
}

Include EdgeResponseStatus in the job's fields so you can split 200s from 404s and from the 403s your own bot rules send.

Vercel

A Vercel log drain sends request logs as newline-delimited JSON. Log drains need a Vercel Pro or Enterprise team. Filter a saved batch with jq:

jq -c 'select((.proxy.userAgent // []) | tostring | test("ChatGPT-User|Claude-User|Claude-Web|Perplexity-User|DuckAssistBot|Google-NotebookLM|MistralAI-User|Amzn-User\\/"; "i"))' vercel-logs.ndjson

proxy.statusCode and proxy.path on each line give you the status and page.

Nginx

Write AI answer fetches to their own log with a map:

map $http_user_agent $ai_bot {
    default 0;
    "~*(ChatGPT-User|Claude-User|Claude-Web|Perplexity-User|DuckAssistBot|Google-NotebookLM|MistralAI-User|Amzn-User\/)" 1;
}

access_log /var/log/nginx/ai-answer-fetch.log combined if=$ai_bot;

The map block goes in the http context; the access_log line goes in the server block for your site.

SQL

If your logs already land in a database, one query splits every kind apart. Coding agents come first so their fetches count on their own:

SELECT
  CASE
    WHEN user_agent ILIKE ANY (ARRAY['%Google-Gemini-CLI/%', '%opencode%', '%claude-code/%', '%QwenCode/%', '%crush/1%', '%Aider/%']) THEN 'coding_agent'
    WHEN user_agent ILIKE ANY (ARRAY['%DuckAssistBot%', '%Amzn-User/%', '%ChatGPT-User%', '%Claude-User%', '%Claude-Web%', '%Perplexity-User%', '%Google-NotebookLM%', '%MistralAI-User%']) THEN 'answer_fetch'
    WHEN user_agent ILIKE ANY (ARRAY['%Google-Agent%']) THEN 'acting_agent'
    WHEN user_agent ILIKE ANY (ARRAY['%Amzn-SearchBot/%', '%OAI-SearchBot%', '%Claude-SearchBot%', '%PerplexityBot%', '%Google-CloudVertexBot%', '%Applebot/%', '%bingbot%', '%MistralAI-Index%']) THEN 'ai_search_index'
    WHEN user_agent ILIKE ANY (ARRAY['%Amazonbot/%', '%GPTBot%', '%ClaudeBot%', '%anthropic-ai%', '%Bytespider%', '%Meta-ExternalAgent%']) THEN 'model_training'
    ELSE 'other'
  END AS ai_traffic,
  count(*) AS requests
FROM access_logs
GROUP BY 1
ORDER BY requests DESC;

Check the requests are real

A user agent is a claim. Anyone can send ChatGPT-User, and scrapers do. Before you act on the numbers, check the source address against the ranges the operator publishes:

  • OpenAI: https://openai.com/chatgpt-user.json, https://openai.com/searchbot.json and https://openai.com/gptbot.json
  • Anthropic: https://claude.com/crawling/bots.json
  • Perplexity: https://www.perplexity.ai/perplexity-user.json and https://www.perplexity.ai/perplexitybot.json
  • Microsoft: https://www.bing.com/toolbox/bingbot.json

Coding agents are the exception. Claude Code and Gemini CLI run on the developer's own machine, so their requests come from ordinary home and office addresses and can't be checked this way.

Read the 404s

Filter AI answer fetches and search crawls to 404 responses and group them by path. Clusters of guessed URLs show the pages AI systems expect you to have. A run of requests for /docs/rate-limits means answers about your product look for rate-limit documentation and find none.

For each cluster, either publish the page or redirect the path to the page that answers it. Then keep your sitemap current so crawlers find the new page quickly: the sitemap checker confirms robots.txt declares your sitemap, shows how fresh its lastmod dates are, and gives you an IndexNow submission to copy.

Track referrals

Referrals come through your analytics, identified by the referrer host or the utm_source tag on the landing URL. The hosts to match:

  • chatgpt.com and chat.openai.com
  • claude.ai
  • perplexity.ai
  • gemini.google.com
  • copilot.microsoft.com
  • meta.ai

Match on utm_source as well as referrer. ChatGPT adds utm_source=chatgpt.com to many of its links, though not all; October 2026 ChatGPT Referral Drop - Unpacked shows what happens to reports when that tag goes missing. Exclude clicks carrying a paid utm_medium so ads don't count as AI referrals.

Do it without the log work

DevTune's AI Traffic does all of the above continuously. Connect one crawler sensor per hostname: a Cloudflare pull, edge middleware in your app, or a Vercel log drain. AI Traffic then counts answer fetches, search crawls, training crawls and coding-agent fetches separately by page and platform, checks hosted crawlers and fetchers against their operators' published addresses, and clusters 404 demand into the pages to publish. Connect GA4, PostHog or the DevTune snippet for referral visits and what they convert to.

The same numbers are available over the REST API and the MCP server, so you can ask Claude Code, Cursor or another agent which pages ChatGPT fetched this week. Integrations has the connect steps for each agent.

Before any of it, make sure the crawlers can reach you: robots.txt for AI search crawlers covers the rules and the CDN settings that block them.

Related posts

  • robots.txt for AI Search Crawlers: Allow ChatGPT, Claude and Perplexity, Block TrainingDec 4, 2026
  • Generative Engine Optimization Services for Developer Tool CompaniesAug 23, 2026
  • AI Visibility Checkers: 5 Free Tools ComparedMay 17, 2026
Are you an agent? View this page in Markdown.Read our AI instructions.
Sign InSign Up
Are you an agent? View this page in Markdown.Read our AI instructions.