Measuring AI agents on your website

Measuring AI agents on your website

Measuring AI agents on your website: a small-site analytics setup that separates bots, assistants and people

A small-site how-to: write a 20-line script that sorts web server log lines into AI training crawlers, AI search crawlers, assistants fetching a page for a user, search engines and likely people, test it on a log you generate yourself, and learn where it fails:

Your analytics dashboard counts people. Your server counts everything that asks for a page, and since AI products started fetching pages on behalf of users, that second number has become worth reading. This how-to builds the smallest useful version: a short Python script that reads an ordinary access log and sorts each request into AI training crawler, AI search crawler, assistant fetching for a user, search engine, other bot or likely person. I tested it on a log I generated myself, from the user-agent strings the vendors publish, and it got something wrong on the first run. I also checked the live robots.txt on corecodify.com, fetched the home page with eight bot identities, and pulled our own Search Console numbers. One limit up front: corecodify.com is a static site on shared hosting, and I cannot read its raw server logs, so I make no claim about how much AI traffic it receives.

The three kinds of visitor, and what each one sends

A request reveals very little: an IP address, a path and a user-agent header. The user-agent is a string the client chooses, so it is a label and not proof, but the major AI vendors publish the labels they use, which is enough for a first pass. They fall into three groups with different rules. Training crawlers such as GPTBot and ClaudeBot collect content for model development and obey robots.txt. Search crawlers such as OAI-SearchBot and PerplexityBot build the index behind an AI search feature. Then there are fetchers that act when a person asks a question, such as ChatGPT-User, Claude-User and Perplexity-User. Those are the closest thing to a visit from a person, and vendors treat them differently from crawlers.

The difference matters because your robots.txt does not control the third group the same way. OpenAI's documentation says of ChatGPT-User: "Because these actions are initiated by a user, robots.txt rules may not apply." Perplexity says of Perplexity-User: "Since a user requested the fetch, this fetcher generally ignores robots.txt rules." One more wrinkle: Google-Extended is not a visitor at all. Google's documentation states that it "doesn't have a separate HTTP request user agent string", so it is a robots.txt token only and you will never see it in a log.

Step 1: write down the labels you are looking for

I copied the example user-agent strings from each vendor's own page on 4 December 2026 and kept them in a table. Anthropic's support page names ClaudeBot, Claude-User and Claude-SearchBot and what each is for, but does not print a full user-agent string, so for those I built a plausible string around the published name. That is a weakness in my test, so the rule matches on the name only.

Published labels and what they mean (checked 4 December 2026)
Label in the logOperatorWhat it isDoes robots.txt apply?
GPTBotOpenAICrawls content that may train modelsYes, vendor says disallowing it opts out
OAI-SearchBotOpenAISurfaces sites in ChatGPT searchYes
ChatGPT-UserOpenAIFetch triggered by a user actionMay not apply
ClaudeBotAnthropicTraining crawlerYes
Claude-SearchBotAnthropicImproves search result qualityYes
Claude-UserAnthropicFetch when a user asks ClaudeVendor says it can be controlled in robots.txt
PerplexityBotPerplexitySurfaces sites in Perplexity searchYes
Perplexity-UserPerplexityFetch triggered by a user questionGenerally ignores it
GooglebotGoogleSearch crawlerYes
Google-Read-AloudGoogleUser-triggered text-to-speech fetchUser-triggered fetcher
Google-ExtendedGooglerobots.txt token only, no user-agent stringYes, token only

Step 2: make a log you can trust, because you made it

I had no access log for corecodify.com, and I did not want to test on invented numbers. So I started a ten-line Python web server on the box that writes each request in the standard combined log format, then sent it real requests: ten user-agent strings with three paths each (the home page, a pricing page and robots.txt), and six page loads from Chrome, three in a headed window and three headless. That made a log of 36 lines. The counts are test traffic that I chose, not a sample of the web, so the percentages below describe my test and nothing else.

Step 3: the classifier, and the line it got wrong

The whole classifier is a list of rules checked in order, where the first match wins. Order matters because OAI-SearchBot's real string also contains Chrome and Safari, and a Googlebot string contains the word Mozilla. Put the specific names first and the generic ones last.

This is the version that produced the results below (anything that starts with Mozilla/ and matches no rule is called a likely person):

Terminal output of the classifier run twice on a 36-request log: first with 6 likely-person lines, then with 3 after adding Google-Read-Aloud to the assistant rule
Real output of classify.py on my 36-line test log, before and after the fix.
classify.py, the rules and the parser (Python 3, standard library only)
import re, sys, json, collections
# Order matters: the first matching rule wins.
RULES = [
 ("ai-training",   r"GPTBot|ClaudeBot|CCBot|Bytespider"),
 ("ai-search",     r"OAI-SearchBot|Claude-SearchBot|PerplexityBot"),
 ("ai-assistant",  r"ChatGPT-User|Claude-User|Perplexity-User|Google-Agent|Google-NotebookLM|Google-Read-Aloud"),
 ("search-engine", r"Googlebot|bingbot|Mediapartners-Google"),
 ("other-bot",     r"bot\b|crawler|spider|curl/|python-requests|Go-http-client|HeadlessChrome"),
]
LINE = re.compile(r'^(\S+) \S+ \S+ \[[^\]]+\] "(\S+) (\S+) [^"]*" (\d{3}) \S+ "[^"]*" "([^"]*)"')
def classify(ua):
    for name, pat in RULES:
        if re.search(pat, ua, re.I if name=="other-bot" else 0): return name
    return "likely-person" if ua.startswith("Mozilla/") else "unknown"

On the first run, six lines came back as likely-person. I knew only three should: the headed Chrome visits. The other three were Google-Read-Aloud, a user-triggered fetcher whose string begins with Mozilla/5.0 and which my rules had not listed, so it fell through to the browser rule. Adding its name to the assistant rule fixed it, and the second run matched what I had sent: 12 assistant-type fetches, 6 training, 6 search, 6 other bots, 3 search engine and 3 likely people. A script that quietly files an unknown fetcher under people is the worst failure here, so read a sample of the unmatched lines regularly.

Step 4: know what the script cannot tell you

Two blind spots showed up in my own test, and neither can be fixed with a longer rule list.

First, the headless Chrome visits were easy to spot because the browser puts HeadlessChrome in its string. The headed Chrome visits were not: their user-agent is identical in form to a person's, so they landed under likely-person, which is what the script is supposed to say about them. An agent that drives an ordinary browser window looks like a visitor in a log, and a user-agent rule cannot separate them.

Second, the label is self-declared. All 30 requests that carried a bot or tool user-agent came from 127.0.0.1, my own machine. I downloaded the IP lists OpenAI publishes (openai.com/gptbot.json had 18 prefixes, searchbot.json 39 and chatgpt-user.json 366 on 4 December) and checked my address against them: none matched, which is exactly what you want to see for a fake GPTBot. Google publishes instructions for verifying its crawlers, and Perplexity publishes its own IP files (both linked below). For anything you plan to block or bill against, verify the address as well as the label.

  • Count a line as confirmed only if the label and a published IP range agree.
  • Keep likely-person as a separate, unverified bucket, and treat it as an upper bound, not a head count.
  • Log the full user-agent for unmatched lines so that new fetchers show up as a pattern.

Step 5: check what your robots.txt actually says to each bot

Logs show who came. robots.txt decides who is invited, so I read ours in a real Chrome window and tested it. The live file has a general group that allows everything except /admin/, /api/, /manage and /catalog-api/, and a second group naming GPTBot, OAI-SearchBot, PerplexityBot, ClaudeBot and Google-Extended with the same rules, so those crawlers are named instead of left to the general group.

Then I fetched the home page once for each of eight identities: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-User, PerplexityBot, Perplexity-User and Googlebot. Every one got HTTP 200 and exactly 36,976 bytes, the same as any other client. In other words, nothing in the hosting or CDN layer treats them differently from a browser, and the only gate is the robots.txt file itself. (Google-Extended is a ninth name in my robots check, but it has no user-agent string to send, so it was only tested against the file.)

Chrome window showing the live corecodify.com robots.txt with a general group and a second group naming GPTBot, OAI-SearchBot, PerplexityBot, ClaudeBot and Google-Extended
corecodify.com/robots.txt as loaded in Chrome on 4 December 2026.

The test turned up a trap. I asked Python's built-in robots.txt parser whether GPTBot, ClaudeBot, PerplexityBot, Googlebot and an unknown bot may fetch /admin/. It said yes for all five. A parser that follows the standard says no. RFC 9309 says: "The most specific match found MUST be used. The most specific match is the match that has the most octets." Our file lists Allow: / before Disallow: /admin/, and Python's parser, in my test, took the first rule that matched, while the longest match is Disallow: /admin/. The file's intent is clear, but a home-made check with the standard library would have told me the private paths were open. I wrote a small longest-match function for the check instead; I did not test how each crawler parses the file.

If you test your robots.txt before a deploy, test it with a parser that implements RFC 9309, and keep the order of rules readable for humans anyway.

Step 6: add the people side, and be honest about its size

Server logs cover machines and people together. For the search side of the picture I queried our Search Console property for corecodify.com for the 28 days from 4 November to 1 December 2026: 12 clicks on 4,520 impressions, an average position of 23.9, with 11 of the clicks on desktop. Search Console reports search clicks and impressions. It does not list crawler visits and it does not show assistant fetches, so it cannot answer the bot question. Its job in this setup is to give a rough sense of scale for real search visitors, and for a young site that scale is small.

The discipline is to keep the buckets separate. A log full of requests is not a crowd of readers, and a report that blends crawlers with people would flatter the site.

Terminal output comparing Python's robots.txt parser with a longest-match check for five bot names on the paths /admin/ and /blog/
Output of rfc.py against the live robots.txt: Python's standard parser allows /admin/, the RFC 9309 longest-match rule does not.

A last practical note. If you want a full pass over crawl access, robots.txt policy and how to confirm a bot is genuine across more crawlers than I covered here, the AI Search Visibility Audit Kit lists 14 AI crawler user-agents with a sample robots.txt policy.

What I did not do

I did not read corecodify.com's own access logs, so there are no figures here for how often AI crawlers visit it. Bingbot, Applebot, Meta's crawlers and others are missing from my table, and Anthropic's strings in the test log were built from its documented names. A 36-line log shows the rules behave on known input, not how they cope with a busy site. With real logs, run the script over a week and read every line it files under likely-person or other-bot before trusting a total.

FAQ

Can I tell an AI agent from a person using the user-agent alone?

Only some of the time. Declared crawlers and user-triggered fetchers name themselves, and the vendors publish those names. An agent that drives a normal Chrome window sends an ordinary browser string, so it counts as a person. In my test the headed Chrome visits were indistinguishable by user-agent, while headless Chrome announced itself as HeadlessChrome.

Does blocking GPTBot or ClaudeBot stop assistants from reading my pages?

No, those names cover training crawlers. OpenAI says GPTBot is for crawling content that may be used in training, and ChatGPT-User is for user actions, where robots.txt rules may not apply. Anthropic lists ClaudeBot, Claude-User and Claude-SearchBot as separate robots with separate effects when disabled. Decide each one on its own.

Why is Google-Extended missing from my logs?

It never appears there. Google's documentation says Google-Extended has no separate HTTP request user agent string and works only as a robots.txt token. Crawling is done with Google's existing user agents.

Sources

About the author

Usama Ali is the founder of CoreCodify, his product brand for ready-made SEO checklists, pricing calculators, freelance kits and AI prompt packs. He also runs Usamify, where he builds websites, web apps, apps, UI/UX design, graphics and AI automations for small businesses. He has been freelancing since 2020, mostly on Fiverr and Upwork.

More about Usama Ali and CoreCodify · Editorial policy

Related reading

Technology

Support ticket triage by the numbers: what 10,003 labelled messages taught a simple classifier

Every help desk now advertises automatic triage, and most of the claims stop at the word accuracy. I wanted numbers I could repeat, so I ran the oldest, cheapest version of the idea: a bag-of-words classifier that reads a customer message and picks a queue. Trained on 10,003 labelled messages and scored on 3,080 it had never seen, it reached 89% accuracy across 77 categories. With only 5 labelled examples per category it managed 56%. The more useful result came from a different dial. When I told it to route a message only if it was at least 55% confident and hand the rest to a person, it handled about 78% of messages on its own, and 96.6% of those went to the right place. This post shows the test, the charts, the failures and a short routine for running the same check on your own inbox.

Read article →

Technology

AI form builders for websites: better lead forms without the friction

Ask a modern form builder for a contact form and you get one in a few seconds: fields, validation, a thank-you page and a notification email, all drafted from one sentence. In 2026 that is no longer a feature of one product. Jotform launched its AI in March, Tally opened Tally AI to everyone in July and put its builder inside ChatGPT and Claude in August, and in November Typeform released an MCP server so an assistant can create, edit and publish a form without opening Typeform at all. The drafting problem is solved. What is not solved is whether the form that comes out suits your business. An AI draft tends to ask for everything a typical form asks for, which is rarely what a good form asks for. This guide is a field-by-field way to edit that draft: what to keep, what to cut and what to reword, how to make the form work for browsers, screen readers and thumbs, how to handle spam when some of the visitors are now AI agents, and why the first hour after someone presses Send matters more than any button colour.

Read article →

Technology

Vibe coding for business websites: when chat-to-code is enough and when it is not

Describe a website to an AI tool in plain English and a few minutes later you can have a working, hosted site with a sign-in form and a database behind it. That is the promise of vibe coding, and for a business owner with a deadline and a small budget it is hard to ignore. The harder question is the one the demo never answers: is the thing it built safe to put in front of customers? In 2026 there is finally enough evidence to answer that with more than opinion. An academic audit of 200 live vibe-coded apps found that 91.0% had at least one vulnerability. A scan of 2,511 public apps found that about one in five Supabase-backed apps let a stranger read a table with nothing but the public key. At the same time, the tools have responded: Lovable now scans every publish and can block it, and Bolt added a security audit to its publish menu in July. This guide is for owners, marketers and freelancers deciding whether to build a business website this way. It sorts what a chat tool handles well from what needs a person's attention, goes through what the evidence says, covers the two things people forget (whether search engines can read the site and whether you can leave the platform), and ends with a brief you can paste into the tool before you publish.

Read article →