Guide · AI agents

How to Track AI Crawler Visits and AI Assistant Referrals

AI companies now read your site in two ways: their crawlers download your pages, and their assistants send people to them. Most analytics tools see neither clearly. This guide shows how to measure both with the tools you already have, step by step.

Updated · 12 min read

Crawls and referrals are different measurements

“AI traffic” usually means two separate things, and they need different tools:

The two kinds of AI traffic compared
AI crawler visits AI assistant referrals
Who arrives Software run by an AI company (GPTBot, ClaudeBot, PerplexityBot…) A person who clicked a link in ChatGPT, Claude, Perplexity, Gemini or Copilot
Runs JavaScript? Almost never Yes, it’s a normal browser
Where you see it Server logs, your CDN, or a server-side collector Your regular analytics, by referrer
What it tells you What AI reads, how often, and what it can’t find How many people AI actually sends you, and to which pages

You want both. Crawls are the supply side: an assistant can only cite a page it has read. Referrals are the outcome: the visitors you get when it does. The rest of this guide covers each, then shows how to put them side by side.

Know the AI agents and what they want

AI agents fall into three groups, and each deserves a different decision:

  • Training crawlers collect content to train future models. They send no visitors directly.
  • AI search crawlers index pages so an assistant can cite and link to them, much like a search engine.
  • User-triggered fetchers load a page right now because a person asked an assistant about it. Each request is a real question.

These are the user agent tokens worth knowing. The token is the part to search for in logs and to use in robots.txt.

Common AI agents, their operators and purposes
Operator Training AI search User-triggered Published IP list
OpenAI GPTBot OAI-SearchBot ChatGPT-User Yes, one per agent
Anthropic ClaudeBot Claude-SearchBot Claude-User Yes, one shared list
Perplexity – PerplexityBot Perplexity-User Yes, one per agent
Meta meta-externalagent – meta-externalfetcher No
Others CCBot (Common Crawl), Bytespider (ByteDance) Amazonbot, Applebot DuckAssistBot, MistralAI-User Varies

Two tokens cause confusion because they never appear in logs. Google-Extended and Applebot-Extended are robots.txt switches only: they control whether content that Googlebot and Applebot already crawl may be used for AI models. Google’s AI Overviews and AI Mode are fed by regular Googlebot, so you can’t separate “Google crawling for AI” from “Google crawling for search” in your logs.

OpenAI is explicit that each of its settings is independent: blocking GPTBot opts you out of training without removing you from ChatGPT search, while blocking OAI-SearchBot keeps your pages out of ChatGPT search answers. Anthropic and Perplexity split their agents the same way.

Why your analytics doesn’t show AI crawlers

Google Analytics, and almost every analytics tool like it, counts a visit when a tag runs JavaScript in a browser. AI crawlers request your HTML and leave without running scripts, so the tag never loads. On top of that, analytics tools filter known bots on purpose to keep human numbers clean.

So if you want to see AI crawlers, you have to look where every request passes: your web server, your CDN, or code running on your server.

Method 1: Read your server logs

Every web server already records each request with its path, status code, referrer and user agent. If you can download your access logs (from your host’s control panel, or /var/log/nginx/access.log and /var/log/apache2/access.log on your own server), you can answer most questions in a few commands. The examples below assume the standard “combined” log format that Nginx and Apache use by default.

1. Keep only AI agent requests. The tokens are case-sensitive here on purpose, so a URL like openai.com/gptbot inside the user agent isn’t counted twice.

AGENTS='GPTBot|OAI-SearchBot|ChatGPT-User|ClaudeBot|Claude-SearchBot|Claude-User|PerplexityBot|Perplexity-User|meta-externalagent|meta-externalfetcher|Amazonbot|Bytespider|CCBot|Applebot|DuckAssistBot|MistralAI-User'

grep -E "$AGENTS" access.log > ai-agents.log

2. Count requests per agent.

grep -oE "$AGENTS" ai-agents.log | sort | uniq -c | sort -rn

3. See which pages one agent reads.

grep 'ClaudeBot' ai-agents.log \
  | awk -F'"' '{split($2, r, " "); print r[2]}' \
  | sort | uniq -c | sort -rn | head -20

4. Find what agents ask for and can’t get. Errors are often the most useful part: they show missing pages, broken redirects, and files like /llms.txt that agents look for.

awk -F'"' '{split($3, s, " ")
  if (s[1] >= 400) {split($2, r, " "); print s[1], r[2]}}' ai-agents.log \
  | sort | uniq -c | sort -rn | head -20

A few things to keep in mind with logs:

  • Caching hides requests. If a CDN or page cache serves a page, your origin server never logs it. Read the CDN’s logs instead, or in addition.
  • Logs rotate. Many hosts keep only a few days. Export them on a schedule if you want trends.
  • A user agent is a claim, not proof. Before you trust any of these numbers, verify the agents.

Method 2: Use your CDN or edge

If your site runs behind a CDN, it sees every request, including cached ones, which makes it a better vantage point than your origin server.

Cloudflare AI Crawl Control is the most complete built-in option. In the Cloudflare dashboard it shows:

  • An Overview of total, allowed and unsuccessful AI crawler requests, with crawlers grouped by company.
  • A Crawlers list with each crawler’s requests and data transferred, and an Allow or Block switch for each one.
  • Metrics by crawler, category, operator or hostname, status code breakdowns, and the most requested paths, with a Patterns view that groups them by section of your site.
  • Filters by date, crawler, operator, hostname and path, CSV export, and the same data through Cloudflare’s GraphQL Analytics API.

Cloudflare’s referral reports (where AI-driven visitors come from) are limited to paid plans, and it only sees traffic proxied through Cloudflare. It also doesn’t connect crawler activity to what those visitors do on your site afterwards.

Other CDNs and hosts (Fastly, Akamai, Vercel, Netlify) offer log streaming or log drains. Send those logs to any tool that can filter by user agent, and the commands from Method 1 apply.

A third option is a few lines of code at the edge or on your server, for example a Cloudflare Worker, Next.js middleware or a WordPress hook, that checks the user agent of each request and forwards matching ones to an analytics endpoint after the response is sent. This catches every request without slowing pages down, and lets you store only what you need.

Verify that an agent is real

Anyone can send GPTBot as their user agent, and scrapers often do, hoping to get through rules that allow AI crawlers. If you count user agents alone, your numbers include these impostors.

For OpenAI, Anthropic and Perplexity, check the IP address against their published lists:

  • OpenAI: openai.com/gptbot.json, openai.com/searchbot.json, openai.com/chatgpt-user.json
  • Anthropic: claude.com/crawling/bots.json (one list for all its agents)
  • Perplexity: www.perplexity.com/perplexitybot.json, www.perplexity.com/perplexity-user.json

This short Python script checks one IP address from your logs against the right list:

import ipaddress, json, sys, urllib.request

LISTS = {
    "GPTBot": "https://openai.com/gptbot.json",
    "OAI-SearchBot": "https://openai.com/searchbot.json",
    "ChatGPT-User": "https://openai.com/chatgpt-user.json",
    "ClaudeBot": "https://claude.com/crawling/bots.json",
    "Claude-SearchBot": "https://claude.com/crawling/bots.json",
    "Claude-User": "https://claude.com/crawling/bots.json",
    "PerplexityBot": "https://www.perplexity.com/perplexitybot.json",
    "Perplexity-User": "https://www.perplexity.com/perplexity-user.json",
}

def networks(url):
    request = urllib.request.Request(url, headers={"User-Agent": "ai-agent-check/1.0"})
    data = json.load(urllib.request.urlopen(request))
    for prefix in data.get("prefixes", []):
        for value in prefix.values():
            try:
                yield ipaddress.ip_network(value)
            except ValueError:
                pass

agent, ip = sys.argv[1], ipaddress.ip_address(sys.argv[2])
print(agent, ip, "verified" if any(ip in net for net in networks(LISTS[agent])) else "NOT verified")
python3 verify_agent.py ClaudeBot 216.73.216.10

The lists change, so download them fresh at least daily if you automate this. If a list can’t be loaded, mark requests as “not checked” rather than fake.

For Google, Bing and Apple, use reverse DNS. Look up the hostname for the IP address, check it belongs to the operator, then look the hostname up again and confirm it returns the same IP:

host 66.249.66.1
# 1.66.249.66.in-addr.arpa domain name pointer crawl-66-249-66-1.googlebot.com.

host crawl-66-249-66-1.googlebot.com
# crawl-66-249-66-1.googlebot.com has address 66.249.66.1

Genuine hostnames end in googlebot.com, google.com or googleusercontent.com for Google, search.msn.com for Bing, and applebot.apple.com for Apple.

Agents without a published list or DNS pattern, such as Meta’s, can’t be verified this way. Report them separately as “unverifiable” so they don’t inflate your verified numbers. Cloudflare users also get this check built in: requests from crawlers on Cloudflare’s verified bots list are identified as such.

For a step-by-step look at impostors, crawlers that pretend to be browsers, and bot traffic in Google Analytics, see how to tell real AI crawlers from fake bot traffic.

Measure visits from AI assistants

When someone clicks a link in an assistant’s answer, they arrive in a normal browser, so your analytics already records the visit. The work is in recognizing it. Look for these referrers:

AI assistant referrer hostnames
Assistant Referrer hostnames
ChatGPTchatgpt.com, older chat.openai.com, plus links tagged utm_source=chatgpt.com
Perplexityperplexity.ai, www.perplexity.ai
Claudeclaude.ai
Geminigemini.google.com, older bard.google.com
Microsoft Copilotcopilot.microsoft.com

ChatGPT adds utm_source=chatgpt.com to many of the links it shows, so count that parameter as well as the referrer. It catches visits whose referrer was stripped.

In Google Analytics 4, recognized assistants are now grouped in the built-in AI Assistant default channel, with the medium set to ai-assistant. Google hasn’t published the full list of assistants it recognizes, so if you need certainty, or want to include newer assistants, create a custom channel group with a rule on Session source matching this regular expression, and place it above the Referral channel:

(^|\.)(chatgpt\.com|chat\.openai\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|bard\.google\.com|copilot\.microsoft\.com|meta\.ai|grok\.com|chat\.deepseek\.com|chat\.mistral\.ai)$

From server logs, the same referrers give you AI-referred landing pages:

awk -F'"' '$4 ~ /(chatgpt\.com|chat\.openai\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|copilot\.microsoft\.com)/ || $2 ~ /utm_source=chatgpt\.com/ \
  {split($2, r, " "); sub(/\?.*/, "", r[2]); print r[2]}' access.log \
  | sort | uniq -c | sort -rn | head -20

Whatever tool you use, treat the result as a minimum:

  • Some assistant apps and in-app browsers send no referrer, so those visits land in Direct. A rise in direct visits to deep pages, not your homepage, is often AI traffic you can’t label.
  • Clicks from Google’s AI Overviews and AI Mode arrive with a normal Google referrer and can’t be told apart from regular search clicks.
  • People who read an answer, then type your name into a search engine, show up as search or direct traffic.

Connect crawls to visits

Each measurement is useful alone; together they tell you what’s working. Put three lists side by side for the same period:

  1. Pages AI search and user-triggered agents request most. These are what assistants are reading and answering with.
  2. Landing pages of AI-referred visitors. These are what assistants actually cite and link to.
  3. Pages agents fail to get. These are what assistants want but can’t use.

Then look for the gaps. A page that is crawled heavily but gets no AI visitors may be read but not cited: check that it answers its question clearly near the top. A page with AI visitors but few crawls is working with little attention: link to it more. A page that fails for agents is a quick fix.

User-triggered fetches deserve special attention. Each ChatGPT-User, Claude-User or Perplexity-User request means a person just asked an assistant something that led to that page. The pages they fetch most are a fair proxy for the questions people ask about you, even when nobody clicks through.

A monthly routine

Once your data flows, a short routine keeps it useful:

  • Verified requests per agent, compared with last month, to spot new agents and sudden spikes.
  • Fake agent requests: impostors claiming to be a known agent, and the addresses they come from. Block them if they put load on your server.
  • Top 20 pages for AI search and user-triggered agents.
  • AI assistant visits by assistant and by landing page, plus their conversions if you track goals.
  • Agent errors: 404s and 5xx responses, fixed or redirected.
  • robots.txt review: are you blocking the agents you meant to block, and only those? Remember that blocking AI search crawlers can remove you from AI answers.

Doing all of this in Metrics Hive

Everything above works with logs and free tools, and you should feel free to use it that way. If you’d rather not maintain scripts, Metrics Hive’s AI agent analytics does the same work in one place:

  • A server-side collector for Cloudflare Workers, Next.js, WordPress or any server records every agent request, including the ones that never run JavaScript, after the page is sent.
  • Agents claiming to be from OpenAI, Anthropic or Perplexity are verified against their published IP lists, refreshed daily. Impostors are listed separately with where they come from and what they request, and never counted.
  • Every agent is grouped into training, AI search or user-triggered, with its requests, pages and verification rate.
  • The pages agents read most sit next to the visitors each page received from ChatGPT, Claude, Perplexity, Gemini and Copilot, so you can see crawl and citation together.
  • Failed agent requests, ready-made robots.txt rules, an llms.txt draft, and alerts when a new agent arrives or fake agents surge.

It runs alongside your regular website analytics, heatmaps and session replays, so AI visitors and human visitors are measured with the same tool.

Frequently asked questions

How can I tell if ChatGPT, Claude or Perplexity crawled my site?
Search your server access logs or CDN logs for their user agent tokens, such as GPTBot, OAI-SearchBot and ChatGPT-User for OpenAI, ClaudeBot, Claude-SearchBot and Claude-User for Anthropic, and PerplexityBot and Perplexity-User for Perplexity. Then check the requesting IP address against the IP list each company publishes, because user agents are easy to fake.
Why doesn’t Google Analytics show AI bots?
Google Analytics and similar tools record visits by running JavaScript in a browser. Most AI crawlers download the HTML and leave without running JavaScript, so the tag never fires, and analytics tools also filter known bots on purpose. You need server logs, your CDN, or a server-side collector to see them.
How do I measure traffic from ChatGPT and other AI assistants?
Count visits whose referrer is an AI assistant domain such as chatgpt.com, claude.ai, perplexity.ai, gemini.google.com or copilot.microsoft.com, plus visits tagged utm_source=chatgpt.com. Google Analytics 4 groups recognized assistants in its AI Assistant channel. Treat the result as a minimum, because some assistant apps send no referrer and those visits land in Direct.
What is the difference between GPTBot, OAI-SearchBot and ChatGPT-User?
GPTBot collects content for training OpenAI’s models, OAI-SearchBot indexes pages so ChatGPT search can show and link to them, and ChatGPT-User fetches a page when a person asks ChatGPT about it. Each has its own robots.txt token, so you can block one without affecting the others.
Can a bot pretend to be GPTBot or ClaudeBot?
Yes. Anyone can send any user agent. OpenAI, Anthropic and Perplexity publish the IP ranges their agents use, so a request is only verified when its IP address is inside the matching list. For Google, Bing and Apple crawlers, use a reverse DNS lookup followed by a forward lookup.
Does Cloudflare show AI crawler traffic?
Yes. Cloudflare AI Crawl Control lists the AI crawlers hitting your zone, their request volume, status codes and most requested paths, and lets you allow or block each one. Its referral reports are limited to paid plans, and it only covers traffic that passes through Cloudflare.

Sources

Checked against these sources on 6 November, 2026. AI companies add and rename agents often, so check their documentation for the latest details.

See Every Visitor, Human and AI

Try any plan free for 7 days and keep your current analytics running alongside while you compare.