如何衡量刑事辯護律師事務所網站的 AI 爬蟲造訪與 AI 引薦流量
Measuring AI Crawler Visits and AI Referrals on a Law Firm Site
衡量刑事辯護律師事務所網站的 AI 流量,需分開追蹤 AI 爬蟲抓取,以及用戶由 AI 答案點擊進站的引薦流量。指南建議從伺服器或 CDN 存取記錄統計 GPTBot、OAI-SearchBot、ClaudeBot 等爬蟲,並在 GA4 以 UTM 或來源網域辨識 AI 引薦。AI 引薦數據可能低估,應將其視為下限,並把電話點擊、表格提交及來電追蹤轉換與 AI 流量來源對照。
If you build or maintain websites for criminal defense firms, someone at the firm will eventually ask whether ChatGPT or Perplexity is sending them clients. It is a fair question, and the honest answer is usually "partly, and we can measure some of it." Two separate things are worth tracking: AI crawlers fetching the site, and people clicking through to the site from an AI answer.
Neither measurement is perfect. Together they give a firm a far better picture than guessing, and they take a few hours to set up. This post covers the server-side and analytics-side pieces, with notes specific to law firm sites.
Know which bots you are looking for
The big AI providers each run more than one crawler, and they do different jobs. OpenAI documents GPTBot for collecting training data, OAI-SearchBot for ChatGPT's search features and ChatGPT-User for pages fetched when a person asks ChatGPT to look something up. Anthropic lists ClaudeBot for training, Claude-SearchBot for search quality and Claude-User for user-initiated fetches. Perplexity documents its own crawler as PerplexityBot.
For a defense firm the search and user-initiated agents are the interesting ones. A visit from OAI-SearchBot or Claude-SearchBot suggests your pages are in the pool those tools can cite. A ChatGPT-User or Claude-User hit means a real person's question led the assistant to fetch your page right then.
User agent strings can be faked. OpenAI publishes IP address lists for each of its crawlers as JSON files, linked from its bot documentation, so you can confirm that a request claiming to be OAI-SearchBot really came from OpenAI. Check the other providers' documentation for similar lists.
Pull the visits from server or CDN logs
JavaScript analytics will not see crawlers, since bots rarely execute your tracking script. You need raw access logs from the server, the host or the CDN. Many managed hosts let you download them, and most CDNs can export or query them.
A quick first pass on a standard access log looks like this:
grep -Eio "(GPTBot|OAI-SearchBot|ChatGPT-User|ClaudeBot|Claude-SearchBot|Claude-User|PerplexityBot)" access.log \
| sort | uniq -c | sort -rn
That gives a count per agent. The next useful cut is which URLs each agent requested. On a law firm site, look at whether the search agents reach the charge pages, the attorney bios and the location pages, or whether they stop at the homepage. If they never reach the charge pages, check robots.txt, your CDN's bot settings and whether those pages are linked from anywhere crawlable.
Run the count monthly and keep the results in a spreadsheet. Trends matter more than any single month.
Capture AI referrals in analytics
The second measurement is human visits that came from an AI tool. ChatGPT appends utm_source=chatgpt.com to many outbound links, which makes those sessions easy to spot in GA4 or any analytics tool that records UTM parameters. Other assistants mostly show up as referrals from their domains, such as perplexity.ai, claude.ai or gemini.google.com.
In GA4, a custom channel group with a rule matching those sources gives the firm a single "AI assistants" line in its acquisition reports. Put the rule above the default Referral channel so the sessions land in the right group.
Expect undercounting. Some app traffic arrives with no referrer at all and lands in Direct. Treat the AI channel as a floor, not a total.
Tie it back to calls and forms
A defense firm does not care about sessions. It cares about calls and consultation requests. Make sure the conversion events for phone clicks, form submissions and call tracking numbers are reported against the AI channel the same way they are for organic search and ads.
If the firm uses a call tracking service with dynamic number insertion, check that it reads the source correctly for sessions tagged by AI tools. Then ask intake staff to record where each new client says they found the firm. A client who says "ChatGPT told me to call you" belongs in the report even if the session data never captured it.
Remember what you cannot see
Google's own AI features are harder to separate. Clicks from AI Overviews and AI Mode arrive from google.com and generally look like ordinary organic traffic in analytics. Google began rolling out a Search Console report for these features in 2026, described in coverage as impressions only and not yet available in every country. A firm can be named in an assistant's answer with no link click at all. Crawl logs and referral data show part of the picture, and a periodic manual check of what assistants say about the firm fills in some of the rest.
For background on why some firms get named and others do not, this explainer on how AI assistants decide which defense lawyer to name covers the factors on the content side.
Privacy notes for law firm sites
Access logs include IP addresses and requested URLs. On a defense site, a URL path can hint at a visitor's legal trouble. Keep raw logs only as long as you need them, limit who can read them and avoid sending them to tools the firm has not approved. The firm's lawyers should decide the retention policy.
More technical notes on AI search and legal marketing technology are collected in the ChatGPT and AI search technology library.
Questions developers ask about AI traffic tracking
Should we block training crawlers to save bandwidth?
That is the firm's decision, not a technical one. Blocking GPTBot or ClaudeBot does not block the search agents, which use separate user agents.
Why do AI referrals show up as Direct?
Some apps open links without passing a referrer. The utm_source parameter that ChatGPT adds helps, but not every assistant adds one.
How often should we review the logs?
Monthly is enough for most firm sites. Look again after a site migration or robots.txt change.
SBD Marketing works only with criminal defense firms, one firm per city. It builds websites for defense practices, handles SEO for the charges a firm defends, works on visibility in AI search tools and runs SEO audits.
來源:DEV Community · dev.to