Sub topic 12
AI crawlers versus visitors who click a link
This chapter assumes you know the GA4 interface and standard reports, understand what a referrer and a UTM parameter are, and have read the earlier chapters on how GA4 assigns source, medium, and channel. It separates two kinds of AI-related traffic that people often mix up: bots that fetch your pages, and humans who click a link inside an AI assistant.
Two different kinds of AI traffic
When someone says "AI traffic," they can mean two unrelated things.
- Crawlers and fetchers are automated programs. They request your pages to train a model, build a search index, or retrieve a page while a user asks a question. They do not click links in a browser, and they usually do not run JavaScript.
- Referral visits are people. A person reads an answer in ChatGPT, Gemini, Perplexity, Copilot, or Claude, clicks a link to your site, and a normal browser loads your page.
GA4 measures sessions by running JavaScript in a browser. That one fact explains most of this chapter. A visit that never runs the GA4 tag never reaches your property.
Why crawlers usually do not appear in GA4
A crawler requests your HTML over HTTP. Most crawlers read the response and stop. They do not execute the gtag.js or Google Tag Manager script, so no page_view event is sent to Google Analytics.
Two further protections reduce the chance that bot traffic reaches your reports:
- GA4 automatically excludes traffic from known bots and spiders, using Google research and the IAB/ABC International Spiders and Bots List. You cannot turn this off, and you cannot see how much was excluded.
- Events that reach GA4 only through the Measurement Protocol need an API secret and a client ID. A crawler has no reason to send those.
The result is that your GA4 numbers do not tell you how often AI systems read your content. For that you need server-side data.
Where crawler traffic is visible
| Source | Shows crawlers? | Shows human referral clicks? |
|---|---|---|
| GA4 reports | Almost never | Yes, when the tag runs |
| Web server access logs | Yes | Yes, as raw requests |
| CDN or WAF analytics (for example Cloudflare, Fastly) | Yes, often with bot classification | Yes |
| BigQuery export of GA4 | No, same data as GA4 | Yes |
| `robots.txt` | Controls access, records nothing | Not applicable |
If you want to know whether a crawler is reading your site, check your access logs and filter by user agent.
Common AI user agents
User agent strings identify many crawlers. Names change and new ones appear, so verify against each vendor's current documentation before relying on this list.
| User agent token | Operator | Typical purpose |
|---|---|---|
| `GPTBot` | OpenAI | Collecting content that may be used for model training |
| `OAI-SearchBot` | OpenAI | Indexing for ChatGPT search results |
| `ChatGPT-User` | OpenAI | Fetching a page when a user asks ChatGPT about it |
| `ClaudeBot` | Anthropic | Collecting content for model training |
| `Claude-User` | Anthropic | Fetching a page on a user's request |
| `PerplexityBot` | Perplexity | Indexing for Perplexity search |
| `Perplexity-User` | Perplexity | Fetching a page on a user's request |
| `Google-Extended` | A `robots.txt` control token for Gemini training use, not a separate crawler | |
| `Bingbot` | Microsoft | Search indexing that also feeds Copilot |
User agent strings can be spoofed. A request that claims to be GPTBot is not proof. Vendors publish IP ranges or reverse DNS rules that let you confirm identity.
The user-triggered fetch: a middle case
Some fetchers act on behalf of a person. When you ask an assistant to summarise a URL, it may fetch the page itself with a user agent such as ChatGPT-User. The person is real, but the request comes from the vendor's server, not from the person's browser.
For GA4 this means:
- The fetch usually runs no tag, so it is not recorded as a session.
- The person who asked never visits your site. They read a summary.
- You gain no session, and you cannot attribute the influence.
This is one reason referral sessions understate how much an AI assistant uses your content.
What a human referral looks like in GA4
When a person clicks a link in an assistant, the browser loads your page and the tag runs. GA4 then records a session with the signals covered in earlier chapters:
- A
page_referrervalue fromdocument.referrer, if the browser sends one. - A
sourceandmedium, for examplechatgpt.com / referral. - Sometimes a UTM parameter that the assistant appends. For example, ChatGPT has appended
utm_source=chatgpt.comto some outbound links.
The URL in the address bar can be checked directly:
https://example.com/guide?utm_source=chatgpt.comWhen that parameter is present, GA4 reads it as the source even if the referrer is missing. This is one of the more reliable signals you can get, but you cannot count on every assistant adding it.
Separating the two in practice
You rarely need to merge crawler and referral data into one number. The two answer different questions.
| Question | Right data source |
|---|---|
| How many people arrive from assistants? | GA4 sessions using your AI channel group |
| Which pages do those people land on? | GA4 landing page report filtered to that channel |
| Do AI systems read my content? | Server or CDN logs filtered by user agent |
| Am I blocking or allowing crawlers? | `robots.txt` and WAF rules |
| Is an assistant citing my page without sending clicks? | Not measurable in GA4; use manual checks or third-party monitoring tools |
Checking logs for crawler activity
This script counts requests per AI user agent token in a standard combined-format access log. It runs with Python 3 and needs no extra packages.
import re
import sys
from collections import Counter
AI_AGENTS = [
"GPTBot",
"OAI-SearchBot",
"ChatGPT-User",
"ClaudeBot",
"Claude-User",
"PerplexityBot",
"Perplexity-User",
"Bingbot",
]
# Combined log format: the user agent is the last quoted field.
line_re = re.compile(r'"([^"]*)"\s*$')
counts = Counter()
with open(sys.argv[1], encoding="utf-8", errors="replace") as log:
for line in log:
match = line_re.search(line)
if not match:
continue
user_agent = match.group(1)
for token in AI_AGENTS:
if token.lower() in user_agent.lower():
counts[token] += 1
break
for token, total in counts.most_common():
print(f"{token}\t{total}")Run it with python3 ai_agents.py /var/log/nginx/access.log. The output is a tab-separated list of agents and request counts. Because user agents can be spoofed, treat the counts as an upper bound until you verify IP ranges.
Do not mix the two in your channel group
A common error is to build the AI channel rule from user agent names or to try to import crawler counts into GA4. Neither works. The custom channel group you built earlier matches on Source, which holds a referrer host or a UTM value. Crawler user agents are never in that field.
Another error is to read a rise in crawler activity as a rise in AI visitors. Crawling often increases before any clicks appear, and many crawled pages never earn a citation.
Edge cases and failure modes
- Headless browsers. Some agents drive a real browser, such as an assistant that browses on behalf of a user. A headless Chrome run executes JavaScript and can fire your tag. These visits may appear as Direct or as a normal session, with no sign they are automated. If you see engagement times of a few seconds, no scrolling, and unusual cities, suspect automation.
- Preview and prefetch. Some apps load a link preview when a link is shared. The preview request may be a server fetch (not recorded) or a prefetch in a browser (sometimes recorded).
- Spoofed referrers. Referrer spam can place an AI host name in the source field. A sudden spike from one assistant with near-zero engagement deserves a check against server logs.
- Consent mode. If a visitor declines analytics consent, their visit may be modelled or not recorded. Referral counts from regions with strict consent rules are lower.
- Tag not on every page. Pages without the tag, such as some PDF files, never record sessions. A person who opens a PDF cited in an assistant is invisible to GA4.
Decision criteria
Choose the tool by the question you are answering.
- If the question is about people and outcomes (sessions, engagement, conversions), use GA4.
- If the question is about machine access (what is being read, how often, by whom), use server or CDN logs.
- If the question is about policy (whether AI systems may use your content), use
robots.txtdirectives and, for stricter enforcement, WAF rules. - If the question is about visibility without clicks, accept that no first-party tool measures it fully.
A simple robots.txt entry shows how policy is set independently of analytics:
User-agent: GPTBot
Disallow: /private/
User-agent: ClaudeBot
Disallow: /This asks GPTBot to avoid /private/ and asks ClaudeBot to avoid the whole site. Compliance is voluntary. The file changes what crawlers may read, and it does not change what GA4 records for human visitors.
Summary of what to remember
- GA4 records sessions only when a browser runs your tag, so it captures people who click, not crawlers.
- Server and CDN logs record crawlers and fetchers. They are the source for machine access data.
- User-triggered fetches serve a person without creating a session.
- Headless or agentic browsing can look like human traffic, so check engagement quality.
- Referral sessions are a floor for AI influence, not a total.
Exercise
Your GA4 AI Assistants channel shows 40 sessions last month, but your server logs show 5,000 requests from GPTBot and OAI-SearchBot. A colleague says GA4 is undercounting by a factor of 125. What is wrong with this reasoning, and which data source answers which question?
Show answer
The two numbers measure different things, so they cannot be compared as one total. The 5,000 log requests are automated fetches by crawlers that do not run the GA4 tag. The 40 sessions are people who clicked a link in an assistant and loaded the page in a browser. GA4 is not undercounting crawlers because it is not designed to record them. Use GA4 for human visits, engagement, and conversions. Use server logs for crawler activity. A large gap between the two can still be useful, since it shows that content is being read far more often than it earns clicks.
Exercise
You see a one-day spike of 300 sessions with source perplexity.ai, an average engagement time of 1 second, and all from one city. Name two checks to decide whether this is real human traffic.
Show answer
First, compare the spike with server logs. Look for a matching burst of requests from one IP range or one user agent, which suggests automation or a headless browser. Second, check engagement and geography in GA4, such as scroll events, key events, device and browser, and city. A single city, near-zero engagement, and identical device details indicate non-human or spoofed traffic. You can also verify whether the landing page is one that Perplexity would plausibly cite.