How to Track Brand Mentions in ChatGPT and Perplexity
Track brand mentions in AI search: pick prompts, run them on ChatGPT and Perplexity on a schedule, log mentions and citations, and spot real changes over noise.
Kazi Khalid Hasan Tamim · BugViso Team
11 min read
To track brand mentions in AI search, write a fixed set of buyer prompts, run them on ChatGPT and Perplexity with web search on, on a schedule, and log for every answer whether your brand is named and which URLs it cites. Compare the rate with named competitors and read change across several runs, never one.
This guide gives you the method, two copy-and-run scripts (Perplexity and OpenAI), a referrer-log check for the traffic side, and the traps that make a mention count look better or worse than it is.
If you want the pipeline run for you, BugViso's AI visibility tracker does the same job across five engines.
The rest of the series on how to measure AI visibility builds on the numbers collected here.
Data used: where this post quotes numbers, they come from 35 unbranded buyer prompts × ChatGPT, Gemini, Perplexity and Claude × 2 runs on 2026-10-20 (280 answers, web search on), collected by BugViso's AI Visibility Tracker for bugviso.com against five anonymised competitors. Everything else is method, not measurement.
How to Track Brand Mentions in AI Search
Five steps cover it. Skip none, because each one fixes a different source of false movement.
- Write 25 to 50 buyer prompts and freeze them. Use questions a buyer would type, not your product's feature list. Our guide to buyer prompts for AI search shows where to find them. Editing prompts later breaks the trend line, so version them (why edits break trends).
- Choose engines that cite sources. Perplexity returns citations by default. ChatGPT cites when its search tool is switched on. Gemini and Claude can both be queried with web search enabled. Track the engines your buyers use, and keep web search on for all of them.
- Run the set on a fixed schedule. Weekly is a sensible start for scripts. Cadence is a sample-size question more than a calendar one; how often to track AI visibility works through it.
- Log two things per answer. Whether the brand is named (mention) and which URLs are cited (citation). Store the raw answer so you can recount later.
- Report rates against competitors, with a range. A mention rate alone has no meaning. Divide by all answers, show named rivals beside it, and quote the spread between runs.
A mention and a citation are different events. A mention means the answer's text names you.
A citation means the answer links to a page of yours. An answer can do one without the other, so log both.
In our 280 answers, 157 named none of the six tracked brands at all, which is why you need a denominator before you read any rate.
What to Log for Each Answer
Log six fields for every answer: the prompt, the engine and model, the date and run, the brands mentioned, the cited URLs and the raw text. Together they let you recompute any metric later.
| Field | What it records | Why it matters |
|---|---|---|
| Prompt id and text | The exact question asked | Lets you recompute any rate by prompt or topic |
| Engine and model | Which engine answered, and which model version | Engines differ, and models change under the same name |
| Date and run number | When the answer was collected | Separates real change from re-ask noise |
| Mentioned brands | Every tracked brand named, in order | Feeds mention rate, share of voice and position |
| Cited URLs | Every link in the answer | Shows which sources engines trust, including competitors' |
| Raw answer text | The full response | Fixes counting rules later without re-asking |
Position and sentiment are optional extras. Add them once the basics are stable; our posts on brand position in AI answers and AI brand sentiment cover both.
How Do You Track Mentions in Perplexity AI?
Call Perplexity's API with each buyer prompt, read the answer text and the returned list of citation URLs, then check whether your brand name appears in the text and whether your domain appears in the citations. Repeat on a schedule and store both results per prompt.
The script below does exactly that for a list of prompts.
#!/usr/bin/env python3
"""Count brand mentions and citations in Perplexity answers.
Usage: PERPLEXITY_API_KEY=... python3 track_perplexity.py
Edit BENCHMARK_PROMPTS, BRAND and DOMAIN first. Perplexity's response
format changes, so check https://docs.perplexity.ai/ if a field is missing.
"""
import os
import requests
API_KEY = os.environ["PERPLEXITY_API_KEY"]
MODEL = os.environ.get("PERPLEXITY_MODEL", "sonar-pro")
BRAND = "bugviso"
DOMAIN = "bugviso.com"
BENCHMARK_PROMPTS = [
"What are the best headless website audit tools for developers?",
"How to test web accessibility WCAG compliance automatically?",
"Best tools to measure Core Web Vitals under throttled mobile 3G?",
"Top Generative Engine Optimization audit platforms",
]
def ask(prompt: str) -> dict:
r = requests.post(
"https://api.perplexity.ai/chat/completions",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"model": MODEL, "messages": [{"role": "user", "content": prompt}]},
timeout=60,
)
r.raise_for_status()
data = r.json()
text = data["choices"][0]["message"]["content"]
# Newer responses list sources in search_results; older ones in citations.
urls = data.get("citations") or [s.get("url", "") for s in data.get("search_results", [])]
return {
"prompt": prompt,
"mentioned": BRAND in text.lower() or DOMAIN in text.lower(),
"cited": any(DOMAIN in u for u in urls),
"urls": urls,
}
if __name__ == "__main__":
rows = [ask(p) for p in BENCHMARK_PROMPTS]
for r in rows:
print(f"mentioned={r['mentioned']!s:5} cited={r['cited']!s:5} {r['prompt']}")
n = len(rows)
print(f"\nMentioned in {sum(r['mentioned'] for r in rows)}/{n} answers, "
f"cited in {sum(r['cited'] for r in rows)}/{n}.")Four prompts is a smoke test, not a measurement. Run the real set at least twice before you trust a rate, because the same prompt can name different brands on a re-ask.
Plain substring matching is also deliberately simple: for aliases, product names and look-alike words, use proper brand mention detection.
How to Track ChatGPT Brand Mentions
OpenAI's Responses API can run a web search inside an answer and attach the sources it used as URL annotations. Ask each prompt with the search tool on, join the text parts of the reply, and collect the annotation URLs.
Read OpenAI's web search guide before you rely on field names, because they are versioned.
#!/usr/bin/env python3
"""Count brand mentions and citations in ChatGPT answers with web search on.
Usage: OPENAI_API_KEY=... [OPENAI_MODEL=<model id>] python3 track_openai.py
Edit QUERIES, BRAND and DOMAIN first. The Responses API output shape is
documented at https://platform.openai.com/docs/guides/tools-web-search
"""
import os
import requests
API_KEY = os.environ["OPENAI_API_KEY"]
MODEL = os.environ.get("OPENAI_MODEL", "gpt-6-luna") # any model that supports the web_search tool
BRAND = "bugviso"
DOMAIN = "bugviso.com"
QUERIES = [
"What are the top automated web accessibility testing tools for developers?",
"Best tools to audit Core Web Vitals under 3G throttling?",
"How to configure robots.txt for AI search crawlers?",
"Leading Generative Engine Optimization platforms",
]
def ask(query: str) -> dict:
r = requests.post(
"https://api.openai.com/v1/responses",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"model": MODEL, "tools": [{"type": "web_search"}], "input": query},
timeout=90,
)
r.raise_for_status()
text, urls = "", []
for item in r.json().get("output", []):
if item.get("type") != "message":
continue
for part in item.get("content", []):
text += part.get("text", "")
urls += [a["url"] for a in part.get("annotations", []) if a.get("type") == "url_citation"]
return {
"query": query,
"mentioned": BRAND in text.lower() or DOMAIN in text.lower(),
"cited": any(DOMAIN in u for u in urls),
}
if __name__ == "__main__":
rows = [ask(q) for q in QUERIES]
for r in rows:
print(f"mentioned={r['mentioned']!s:5} cited={r['cited']!s:5} {r['query']}")
n = len(rows)
print(f"\nMentioned in {sum(r['mentioned'] for r in rows)}/{n}, "
f"cited in {sum(r['cited'] for r in rows)}/{n}.")The API is not the same product as the ChatGPT app. It does not show what a signed-in user's saved memory or location would change, and its model may differ from the app's.
AI visibility API vs scraping explains which of the two to trust and why.
Check the Traffic Side With Referrer Logs
Mentions are one half of the picture. The other half is whether anyone clicks through.
AI answer engines send a referrer when a reader follows a cited link, and their crawlers announce themselves in the user agent.
| AI answer engine | Referer you may see | Crawler user agent |
|---|---|---|
| ChatGPT | https://chatgpt.com/ | OAI-SearchBot, ChatGPT-User |
| Perplexity | https://www.perplexity.ai/ | PerplexityBot |
| Claude | https://claude.ai/ | Claude-SearchBot, Claude-User |
| Google AI Overviews | https://www.google.com/, no distinct referrer | Googlebot |
# Count AI referrals in an NGINX access log (combined format: referer is field 11)
grep -E "chatgpt\.com|perplexity\.ai|claude\.ai" /var/log/nginx/access.log | awk '{print $7, $11}' | sort | uniq -c | sort -rn | headTreat the volumes as a sanity check. Referrer headers are often stripped, so the real number is higher than the logs show, and AI Overviews traffic hides inside ordinary Google organic.
If the crawlers themselves are blocked, nothing else here matters; check your robots.txt against RFC 9309 rules for OAI-SearchBot and PerplexityBot.
Why One Run Is Not a Trend
Whatever method you pick, repeat it. In our own data, AI answers changed between two runs 23 minutes apart in 40% of shortlists that named a tracked brand.
A mention rate moving from 7% to 11% between two single runs can be noise.
Pool several runs before you compare periods, and compare on the same prompts. AI share of voice is only comparable when counted once per answer on unbranded prompts, and a competitor benchmark needs paired comparisons on the same answers.
Keep branded prompts out of the mention rate: branded prompts name you by definition.
What to Do When the Tracking Shows You Are Missing
When tracking shows competitors named and cited where you are not, work from the cited sources, not from guesses. The citation gap analysis post shows how to list the pages that cite rivals but not you.
Beyond that, four basics apply:
- Put a direct answer of about 40 to 60 words under each heading, so an engine can lift it whole.
- Put comparisons in real HTML tables with exact specs rather than images.
- Publish complete Organization and SoftwareApplication JSON-LD.
- Confirm
OAI-SearchBotandPerplexityBotare allowed inrobots.txt.
For how engines pick sources, see our guides on how ChatGPT search selects and cites sources, getting cited by Perplexity and generative engine optimization.
How BugViso Tracks AI Citations
BugViso's AI Visibility Tracker runs this method for you. It asks ChatGPT, Gemini, Perplexity, Claude and Google AI Overviews your buyer prompts (50 by default, drafted from your site and editable), against three or more competitors, on demand or on a daily, weekly or monthly schedule.
For each engine it reports mentions, rank and share of voice, plus the sources each engine cited and the third-party pages that cite your competitors but not you. The scripts above are the do-it-yourself version, good for a handful of prompts and one engine.
Frequently Asked Questions About Tracking AI Brand Mentions
How often should we track brand mentions in AI search?
Weekly is a workable start for a script, with several runs pooled before you compare periods. The right cadence depends on how many answers you need for a stable rate, not on the calendar.
Review server referrer logs monthly to spot traffic trends.
What is a good AI citation share of voice?
There is no universal benchmark for AI citation share of voice. It depends on your category and prompts, so compare your citation rate with named competitors on the same prompts and engines.
Why does ChatGPT cite a competitor instead of our brand?
Often because the sources it retrieves list the competitor and not you. Check which pages were cited, whether they are third-party reviews or comparisons, and whether your own pages answer the question directly in plain HTML.
The citation gap analysis above finds those pages.
Do AI citations drive qualified website traffic?
Sometimes. Check your own analytics: filter referral traffic from chatgpt.com, perplexity.ai and claude.ai and compare conversion rates with organic search.
Volumes are usually small, so judge by your data, not a general multiplier.
How can I test whether AI crawlers can read my site?
Run a BugViso scan to check AI crawler access in robots.txt, validate your /llms.txt and get a 0-100 GEO citability score.
Start With One Prompt Set and Two Engines
AI citation tracking tells you whether AI answers mention you at all, and whether that changes after you fix something. Freeze the prompts, log mentions and citations separately, repeat the run, and re-measure after each change.
Then move to the AI visibility audit in 5 minutes if you want a manual first look.
Written by
Kazi Khalid Hasan Tamim · BugViso Team
Kazi writes BugViso’s guides on website audits, Core Web Vitals, technical SEO, accessibility and AI search. The data in them comes from audits BugViso runs in a real Chromium browser, including our 219-site study of website health.
Summarise with AI
Open this guide in your assistant.
Follow BugViso
New guides and audit data as we publish them.
AI visibility tracker
Is your brand in AI answers?
See how often AI assistants mention you, cite your site and rank you against your competitors.
- ChatGPT
- Gemini
- Perplexity
- Claude
- AI Overviews
See where your site stands
Run a free BugViso audit for SEO, speed, accessibility and AI search readiness — with fixes you can ship today.