How many visitors do ChatGPT and Perplexity actually send you? Count them from your access logs A developer at Get AI Vizible published a Python script that counts visits sent to a site by AI assistants such as ChatGPT, Perplexity, Gemini, Copilot, Claude, DeepSeek and Grok, using only the standard library and Apache/Nginx combined access logs. The script matches the Referer header against known assistant hosts and also catches ChatGPT's utm_source=chatgpt.com tag, which it says is often the only trace left when mobile apps strip the referrer, then reports per-assistant totals and top landing pages. On a small test log it attributed 6 of 8 successful page views to an AI assistant. Disclosure: I work on Get AI Vizible https://getvizible.online , which tracks how AI assistants mention brands. Nothing below needs it: just a log file and the Python standard library. This post was drafted by an AI agent for our team; the script was run against a test log before publishing. Everyone is talking about "AI search traffic", but most analytics dashboards lump it into "referral" or "direct". If you have server access logs, you can get a real number in a few minutes, and see which pages the assistants are sending people to. When someone clicks a link inside an AI assistant's answer, the visit usually carries the assistant's domain in the Referer header: | Assistant | Referrer host | |---|---| | ChatGPT | chatgpt.com older links: chat.openai.com | | Perplexity | perplexity.ai / www.perplexity.ai | | Gemini | gemini.google.com | | Microsoft Copilot | copilot.microsoft.com | | Claude | claude.ai | | DeepSeek | chat.deepseek.com | | Grok | grok.com | ChatGPT also appends utm source=chatgpt.com to the links it shows. That matters, because the mobile apps often strip the referrer: the UTM tag is then the only trace left in the request. It reads the standard Apache/Nginx "combined" format, keeps successful GET requests, and counts the ones that came from an assistant, with the top landing pages for each: bash /usr/bin/env python3 """Count visits that AI assistants send to your site, from an access log. Usage: python ai referrals.py access.log access.log.1 ... Reads Apache/Nginx "combined" format. Standard library only. """ import re import sys from collections import Counter, defaultdict from urllib.parse import urlsplit, parse qs Referrer host - assistant. Subdomains match too www.perplexity.ai . AI HOSTS = { "chatgpt.com": "ChatGPT", "chat.openai.com": "ChatGPT", "perplexity.ai": "Perplexity", "gemini.google.com": "Gemini", "copilot.microsoft.com": "Copilot", "claude.ai": "Claude", "chat.deepseek.com": "DeepSeek", "grok.com": "Grok", } ChatGPT adds utm source=chatgpt.com to links it shows; this catches visits whose referrer was stripped common from the mobile apps . AI UTM = {"chatgpt.com": "ChatGPT"} LINE = re.compile r' ?P