AI Visibility · GEO Field Guide
How to Check If ChatGPT Mentions Your Brand: A Free Python AI Visibility Tracker
Short answer: to check your brand’s AI visibility, run a fixed set of buyer-style questions through the ChatGPT (OpenAI) API on a schedule and log whether your brand gets named in the answers. It is the AI equivalent of a rank tracker. Below is the exact free Python script I use, how to read the results, and the GEO moves that actually improve them.
Google is no longer the only place people search. Millions now ask ChatGPT, Claude, Gemini, and Perplexity for recommendations before they ever open a results page. If your brand is missing from those answers, you are invisible to a fast-growing slice of your market, and unlike a Google ranking, nothing tells you by default. You have to measure it deliberately, which is exactly what this guide does.
What this tracker does
The script sends a set of targeted prompts to the OpenAI API, the same questions your potential customers might type, and logs the full responses. It checks whether your brand name appears, repeats each prompt a few times because AI answers vary, and exports everything to an Excel file you can review or chart. Think of it as a rank tracker for AI answers.
Why AI visibility matters in 2026
AI answers now shape buying decisions long before someone reaches your website. Traditional SEO measures keyword rankings; AI visibility measures something newer, whether a language model names you when it answers your customer’s question. That metric now sits alongside rankings in any serious SEO consulting engagement, because a customer who gets a confident recommendation from ChatGPT often never runs the Google search you optimised for.
The discipline has a name now: GEO, or generative engine optimization. It is the same instinct as SEO, applied to language models instead of the ten blue links. And the early research is blunt about where visibility comes from. Studies of generative engines suggest roughly 82 percent of AI citations come from third-party earned media rather than a brand’s own site, which means the question is not only what you publish, but whether the wider web treats you as an authority.
If your brand is not mentioned when an AI answers your customer’s question, you have lost that touchpoint silently, and no dashboard is going to warn you.
How AI engines actually answer, and why it changes the fix
The three engines your customers use do not source answers the same way, so the way you earn a mention differs by platform.
ChatGPT
Blends static training data with a live retrieval layer for current queries. It rewards durable authority and consistent mentions across the web, which build up over time.
Perplexity
Retrieves from the live web on almost every query, so a fresh, well-structured page can surface in its answers within hours. Speed and structure win here.
Gemini
Leans on Google’s index and query fan-out, expanding your question into sub-questions and pulling a source for each. Strong classic SEO carries over directly.
This is why a single tactic rarely fixes everything. Perplexity rewards fresh, structured content fast; ChatGPT rewards being talked about across the web; Gemini rewards the technical SEO foundations you should already own. Measuring first tells you which gap is actually yours.
Before you start: what you need
The complete tracker script
Create a file called tracker.py and paste the code below. Replace YOUR_API_KEY_HERE with your real key, then swap BRAND_NAME and the prompts for your own business. The example uses WizMantra, an online language-learning brand I run, so you can see real category questions in action.
from openai import OpenAI
import pandas as pd
import datetime
# Configuration
client = OpenAI(api_key="YOUR_API_KEY_HERE")
BRAND_NAME = "wizmantra" # lowercase, for case-insensitive matching
RUNS_PER_PROMPT = 3 # AI answers vary, so ask more than once
MODEL = "gpt-4o-mini" # any current chat model works
# The buyer-style questions your customers actually ask
prompts = [
"What is WizMantra?",
"Who are the best online spoken English class providers?",
"Recommend online Hindi classes for beginners.",
"Which companies offer online Sanskrit courses?",
]
# Main tracking loop
records = []
for prompt in prompts:
hits = 0
for run in range(RUNS_PER_PROMPT):
try:
resp = client.chat.completions.create(
model=MODEL,
messages=[{"role": "user", "content": prompt}],
temperature=0.7,
)
answer = resp.choices[0].message.content
mentioned = BRAND_NAME in answer.lower()
hits += 1 if mentioned else 0
records.append({
"date": datetime.datetime.now().strftime("%Y-%m-%d %H:%M"),
"prompt": prompt,
"run": run + 1,
"brand_mentioned": "Yes" if mentioned else "No",
"response": answer,
})
except Exception as e:
records.append({
"date": datetime.datetime.now().strftime("%Y-%m-%d %H:%M"),
"prompt": prompt,
"run": run + 1,
"brand_mentioned": "Error",
"response": str(e),
})
# Visibility rate for this prompt, 0 to 100 percent
print(prompt, "->", round(100 * hits / RUNS_PER_PROMPT), "percent visible")
# Export the full log to Excel
pd.DataFrame(records).to_excel("ai_visibility_log.xlsx", index=False)
print("Done. Full log saved to ai_visibility_log.xlsx")
Run it and read the results
Save the file, then run python3 tracker.py in the same folder. The terminal prints a visibility rate for each prompt, and the full log lands in ai_visibility_log.xlsx. It looks something like this:
| Prompt | Response (truncated) | Brand named |
|---|---|---|
| What is WizMantra? | WizMantra is an online language-learning platform offering… | Yes |
| Best online spoken English providers? | Popular options include Preply, Cambly, italki… | No |
| Recommend online Hindi classes. | Several institutes offer beginner Hindi classes… | No |
| Companies offering online Sanskrit courses? | WizMantra is one platform that offers Sanskrit… | Yes |
How to read your AI visibility score
The brand-named column is your core metric. Read it in two layers:
- Direct brand prompts (“What is [brand]?”) should almost always come back Yes. If they do not, your brand has close to zero footprint in the model, a serious signal that the wider web barely references you.
- Category prompts (“best providers of X”) coming back No means competitors are capturing the AI recommendation you want. That is the gap worth money.
- Track the rate, not one answer. Because you run each prompt three times, you get a visibility percentage per prompt. Watch that number move month over month as you build authority.
How to actually improve your AI visibility (the GEO playbook)
Once you know where you are invisible, the fixes are specific, and several are backed by early GEO research rather than guesswork.
- Front-load the answer. Put the clear, quotable answer near the top of the page, not buried under a long intro. Nearly half of AI citations are pulled from the opening portion of a page.
- Add evidence. Cite sources, add real statistics, and include short quotations. Princeton’s GEO research found these lift AI visibility by 30 to 40 percent, and adding citations alone produced a 115 percent relative lift for pages mid page one. Models prefer content they can verify.
- Earn third-party mentions. If most AI citations come from earned media, then digital PR, expert commentary, directories, and reviews are not optional. A brand the web talks about is a brand the models repeat.
- Fix your entity. Keep your name, category, and description consistent across your site and every profile, and mark it up with structured data so machines resolve you to one clear entity.
- Build a cluster, not a lonely post. Models cite brands that cover a topic across several linked pages. This is the same topical authority logic that already wins in search, and it is why sequencing matters, technical foundation first, content second.
- Keep it fresh. Language models favour the most recent version of an article that matches a query, so update and re-date your cornerstone content instead of letting it age.
Scaling this further
The script is a foundation. Once it is running, extend it:
- Test across multiple models, OpenAI, Claude, and Gemini, since each has different training and retrieval sources.
- Add a sentiment column, so you track not just whether you are mentioned, but how positively.
- Schedule it with cron to run weekly and build a trend line automatically.
- Pipe results into Google Sheets for a live team dashboard.
Frequently asked questions
What is AI visibility?
AI visibility is whether large language models like ChatGPT, Gemini, and Perplexity name your brand when they answer your customers’ questions. It is the AI-era equivalent of a keyword ranking, measured by mention rather than position.
What is GEO (generative engine optimization)?
GEO is the practice of optimising your content and brand so AI engines cite and recommend you. It reuses SEO foundations, authority, structure, and clear entities, but the target is the AI answer, not the search results page.
Does ChatGPT use the live web or only training data?
Both. ChatGPT blends static training data with a live retrieval layer for current queries. Perplexity retrieves from the live web on almost every query, and Gemini leans on Google’s index. That is why fresh, well-structured content can surface quickly in some engines and slowly in others.
How often should I run the tracker?
Monthly is a sensible baseline, plus a run after any major content or PR push. Always repeat each prompt at least three times, because AI answers vary between runs and a single response can mislead you.
Do I need to know how to code?
Only a little. If you can open a terminal, install a package, and paste a script, you can run this. If you would rather not, the same measurement can be set up for you as part of a consulting engagement.
Is AI visibility replacing SEO?
No, it complements it. The same signals that earn AI citations, authority, clean structure, consistent entities, and third-party mentions, are the signals that already drive strong search rankings. You are extending SEO, not abandoning it.
Want to know if AI is recommending you or your competitors?
I run AI visibility and GEO audits alongside classic SEO, measuring where you show up across ChatGPT, Perplexity, and Gemini, then building the authority and structure that gets you cited. Start with a conversation.
