AEO & GEO

How to Measure AI Visibility: Learn from Best 9 AEO Tools

Build a reliable AI visibility baseline, compare nine tools, track brand mentions and citations, and turn buyer questions into practical improvements.

22 min read
A racing driver beside a futuristic car overlooking a track of AI search and citation signals.

AI visibility is how often, how prominently and how accurately AI answer engines name and cite your brand when buyers ask questions in your category. You measure it with a fixed set of buyer prompts, run on a schedule across ChatGPT, Perplexity, Gemini, Google AI Overviews/AI Mode, Claude and Copilot, scored on six metrics. This guide shows how to do that with the nine leading AEO (answer engine optimization) tools, plus the scripts to run your own tracker when a tool is too expensive or too opaque.

Why it matters now: a growing share of research starts in an answer engine, and the answer usually names three to five vendors. If you are not one of them, the buyer never reaches your page. Classic rank tracking cannot see this, because there is no "position 1" — there is a paragraph, and you are either in it or not.

What you will have by the end:

  • A metrics framework you can report to leadership every month
  • A prompt set built from real buyer questions
  • A clear view of which of the nine tools fits your team and budget
  • What the ChatGPT retrieval leak means for measurement, plus a Python tracker, a GA4 setup and log-file and HAR scripts you can run today
  • A 30-day plan to move from baseline to improvement

The AI visibility metrics framework

Track seven metrics; the first four are your core scorecard, the last three tell you why it moves. Every tool below reports some version of these, under different names, so define them once and map each tool onto them.

Metric

What it answers

How to calculate

Healthy target (B2B, typical)

Mention rate

Do we show up at all?

Answers that name your brand ÷ total answers

30–60% on category prompts

Share of voice (SoV)

Do we show up more than rivals?

Your mentions ÷ all tracked-brand mentions

Above your market share

Citation rate

Does the engine link to our pages?

Answers citing your domain ÷ total answers

10–30%

Average position

Are we named first or last?

Mean rank of your brand in the order brands appear

Top 3

Sentiment

Is the description favourable?

Positive − negative mentions ÷ mentions

Net positive

Accuracy

Are the facts about us right?

Answers with correct pricing, features, positioning ÷ mentions

95%+

AI referral traffic

Does visibility turn into visits?

Sessions from chatgpt.com, perplexity.ai, gemini.google.com etc.

Rising month on month

The targets are rules of thumb, not industry standards; your first month's numbers are the real baseline.

For ChatGPT, add two leading indicators from the retrieval research in the next section: fan-out inclusion (share of runs where your brand appears in ChatGPT's own search queries) and retrieved-to-cited rate (pages of yours that were fetched and then cited). They tell you whether you are losing at the shortlist or at the citation.

Three principles keep the numbers honest:

  1. Sample, don't spot-check. AI answers are non-deterministic. Run each prompt at least 3–5 times per engine per cycle and report the average. One screenshot is an anecdote.
  2. Segment by intent. A 70% mention rate on "what is [your brand]" prompts means nothing. Report category, comparison and problem prompts separately.
  3. Hold the prompt set fixed. Change prompts quarterly, not weekly, or you cannot tell whether visibility moved or the questions did.

A single composite score is useful for executives. A simple version:

\text{AI Visibility Score} = 0.4 \cdot \text{Mention rate} + 0.3 \cdot \text{SoV} + 0.2 \cdot \text{Citation rate} + 0.1 \cdot \frac{1}{\text{Avg position}}

Keep the weights stable once you publish them; the trend is what matters.

What the ChatGPT retrieval leak changes about measurement

Being retrieved is not being cited: in one researcher's captures, ChatGPT fetched 3,554 pages across 57 conversations and cited only 110 of them (3.1%). That finding comes from researchers who read ChatGPT's own network traffic, often called the "retrieval leak". It is not an official OpenAI disclosure, but it shows what happens between a buyer's question and the answer, and it changes what you should measure.

How a ChatGPT answer is built, and what to measure at each step

The brands ChatGPT puts in its own first search are the ones that usually make the answer, so measure from that step onward, not only the final text.

What the traffic shows

  • ChatGPT rewrites the question before searching. In a preprint covered by Search Engine Journal, ChatGPT never searched with the user's exact wording for GPT-5.3 or GPT-5.5 Instant. For Chinese questions, about 67–70% of its searches were in English only.
  • The shortlist is set in the first query. In 21 of 27 conversations, the first search query already named brands the user never typed. Brands named in ChatGPT's own query reached the answer 68.9% of the time; brands that were only fetched reached it 2.1% of the time.
  • Several fetch pipelines sit behind the answer. A stored field labelled each source with the system that fetched it (serp, labrador, bright, oxylabs, later bing). That label was removed from the stored data on 24 July 2026, so it is no longer visible.
  • Citations are bound to sentences. Each cited source is tied to the exact span of the answer it supports, and runner-up pages that backed the same claim but lost the citation are recorded too.
  • Rank inside a source group matters. The first page in a domain group was cited 5.2% of the time; the sixth or later, 0.3%.
  • Answers vary a lot. In the preprint, 41–45% of distinct cited pages appeared in only one of 20 runs of the same question.
  • The API is a weak stand-in for the app. Google results plus OpenAI's API together found only 26–28% of the pages ChatGPT cited, though about half of the sites.

The brand-shortlist, conversion and rank numbers come from one researcher's logged-in account (Suganthan's live tracker) and are directional. The variation and API numbers come from a 2026 preprint (arXiv 2610.15382) that has not been peer reviewed and predates GPT-5.6.

How to measure differently because of it

  1. Split one metric into three. Track retrieved (your page was fetched), cited (a sentence links to you) and mentioned (your brand is named). A brand can be mentioned with someone else's page as the source.
  2. Track the fan-out queries. Record which brands appear in ChatGPT's own search queries. Being in the first query is the strongest early signal of making the answer.
  3. Report at site and page level. Site-level overlap between runs is much higher than page-level, so a site-level citation rate is the steadier KPI. Page-level shows which assets win.
  4. Sample more, not less. With almost half of cited pages appearing once in 20 runs, 3 runs is a floor. Use 5–10 for the prompts you report to leadership.
  5. Ask vendors how they collect. A tool that queries the API measures something different from what buyers see in the app. Ask whether it uses the consumer app, logged-in sessions and which models.
  6. Re-baseline after model changes. Citation patterns shift when OpenAI updates the default model, so mark each model change on your trend chart.

Capture fan-out queries and citations yourself

You can see these fields in your own ChatGPT sessions. Open ChatGPT in Chrome, open DevTools → Network, ask a question, and save the conversation response as a HAR file (right-click → Save all as HAR). This script pulls out the search queries and cited URLs. Field names change month to month, so it searches the payload for them by name instead of relying on fixed paths.

# har_citations.py — extract fan-out queries and cited URLs from a saved ChatGPT HAR file
# usage: python har_citations.py chatgpt.har YourBrand CompetitorA CompetitorB
import json, re, sys

QUERY_KEYS = {"search_queries", "search_model_queries", "queries"}
URL_KEYS = {"url"}
queries, urls = [], []

def walk(node):
    if isinstance(node, dict):
        for k, v in node.items():
            if k in QUERY_KEYS and isinstance(v, list):
                queries.extend(q.get("q", q) if isinstance(q, dict) else q for q in v)
            elif k in URL_KEYS and isinstance(v, str) and v.startswith("http"):
                urls.append(v)
            else:
                walk(v)
    elif isinstance(node, list):
        for x in node:
            walk(x)
    elif isinstance(node, str):
        # tool-call text such as "fast|Zendesk AI agents pricing 2026|30|zendesk.com"
        for line in node.splitlines():
            parts = line.split("|")
            if len(parts) >= 3 and parts[2].strip().isdigit():
                queries.append(parts[1].strip())

har = json.load(open(sys.argv[1]))
for entry in har["log"]["entries"]:
    body = entry.get("response", {}).get("content", {}).get("text") or ""
    for chunk in re.split(r"\n(?:data: )?", body):
        try:
            walk(json.loads(chunk.removeprefix("data: ")))
        except (json.JSONDecodeError, AttributeError):
            continue

brands = [b.lower() for b in sys.argv[2:]]
print("Fan-out queries:")
for i, q in enumerate(dict.fromkeys(map(str, queries)), 1):
    named = [b for b in brands if b in q.lower()]
    print(f"  {i}. {q}" + (f"   <- names {', '.join(named)}" if named else ""))
print("\nURLs in the response:")
for u in dict.fromkeys(urls):
    print("  ", u)

Run the same question five times and count how often your brand appears in the first query. Do this only in your own account, for your own research, and within OpenAI's terms of use; it is a diagnostic, not a replacement for a tracking tool.

Step 1: Build a prompt set from real buyer questions

Your prompt set is the single biggest driver of measurement quality: 50–150 prompts, written the way buyers actually ask, split across five intent buckets. Every tool in this guide needs one, so build it before you buy anything.

Bucket

Share of set

Example (project management software)

Category discovery

30%

"What are the best project management tools for a 20-person agency?"

Problem / jobs-to-be-done

25%

"How do I stop client projects going over budget?"

Comparison

20%

"Asana vs Monday vs [your brand] for creative teams"

Evaluation / objections

15%

"Is [your brand] secure enough for healthcare data?"

Brand

10%

"What does [your brand] cost?" "What is [your brand] known for?"

Where to find the real questions:

  • Sales call transcripts (Gong, Chorus, Fathom): the questions prospects ask in discovery calls
  • Support tickets and onboarding chats
  • Reddit, Quora and G2 reviews in your category
  • "People also ask" boxes and Search Console queries of 8+ words — long queries are the closest thing to prompts
  • Your competitors' comparison pages

Add modifiers to mirror how people really prompt: role ("as a CFO"), company size, region, budget and constraints. Engines personalise heavily on these, so "best CRM" and "best CRM for a 10-person real-estate team in Texas" can name entirely different vendors.

Script: expand seed questions into a prompt set

This script turns a short list of seed questions and personas into a tagged CSV that you can load into any tool or into the tracker in Step 3.

# build_prompts.py — expand seeds x personas into a tagged prompt set
import csv, itertools

BRAND = "YourBrand"
COMPETITORS = ["CompetitorA", "CompetitorB", "CompetitorC"]

seeds = {
    "category":   ["What are the best {cat} tools for {persona}?",
                   "Which {cat} software should {persona} use in 2026?"],
    "problem":    ["How can {persona} {pain}?"],
    "comparison": ["{a} vs {b} for {persona}: which is better?"],
    "evaluation": ["Is {brand} a good choice for {persona}?",
                   "What are the downsides of {brand}?"],
    "brand":      ["How much does {brand} cost?", "What is {brand} best known for?"],
}

cat = "project management"
pains = ["keep client projects on budget", "track team workload"]
personas = ["a 20-person marketing agency", "a remote software team", "an enterprise PMO"]

rows = []
for bucket, templates in seeds.items():
    for t in templates:
        for persona in personas:
            if "{pain}" in t:
                for pain in pains:
                    rows.append((bucket, t.format(persona=persona, pain=pain, cat=cat)))
            elif "{a}" in t:
                for a, b in itertools.combinations([BRAND] + COMPETITORS, 2):
                    if BRAND in (a, b):
                        rows.append((bucket, t.format(a=a, b=b, persona=persona)))
            else:
                rows.append((bucket, t.format(persona=persona, cat=cat, brand=BRAND)))

rows = sorted(set(rows))
with open("prompts.csv", "w", newline="") as f:
    w = csv.writer(f)
    w.writerow(["id", "bucket", "prompt"])
    for i, (bucket, prompt) in enumerate(rows, 1):
        w.writerow([f"P{i:03d}", bucket, prompt])
print(f"Wrote {len(rows)} prompts")

Review the output by hand and delete anything a real buyer would never type. Twenty sharp prompts beat two hundred synthetic ones.

Shortcut: research the questions with WhatBuyersAsk

If you would rather not mine transcripts and forums by hand, WhatBuyersAsk does this step for you: it researches the questions buyers ask before choosing a provider, then checks whether your website answers them. Where the nine tools in Step 2 track how visible you are, WhatBuyersAsk is built to find what to be visible for and what to fix.

  • What it produces: a list of buyer questions (Buyer asks), the questions your site fails to answer (Answer gaps), competitor and third-party source evidence, prioritised page actions, content briefs, and client-ready reports.
  • AEO package: a ZIP with llms.txt, Markdown versions of pages and schema files, ready to hand to developers.
  • Who it suits: agencies, consultants and B2B marketing teams; it also covers local businesses (directories, reviews, nearby competitors).
  • Pricing: a 10 USD one-off pilot run, 40 USD per 30 days for site owners (up to 5 runs for one website), and 150 USD a month for agencies (150 credits, shared across clients). See pricing.

How to use it in this workflow:

  1. Run it on your site plus 2–3 competitors to get the buyer-question list and answer gaps.
  2. Load those questions into prompts.csv (tagged by bucket) and into whichever tracking tool you choose in Step 2.
  3. Turn the answer gaps and content briefs into the fixes in Step 5, then re-measure the same prompts.

WhatBuyersAsk runs its tests through model APIs and names the models in each report; it is not continuous monitoring of ChatGPT, Perplexity or AI Overviews, so pair it with a tracking tool or the DIY tracker for trend lines.

Disclosure: this guide is published by WhatBuyersAsk.

Step 2: Measure with the top 9 AEO tools

No single tool wins on everything. Profound and Scrunch go deepest, Semrush and Ahrefs win if you already pay for them, and Otterly.AI, Rankscale and Peec AI give the most visibility per dollar. Entry prices run from free trials to about 300 USD a month; engine coverage often depends on the plan.

Tool

Best for

Engines tracked

Standout capability

Entry price (USD/month)

Profound

Enterprise brands

Up to 9 on Enterprise: ChatGPT, Perplexity, AI Overviews, AI Mode, Gemini, Copilot, Claude, DeepSeek, Exa (trial: 3)

Prompt Volumes + Agent Analytics (AI crawler data)

Free 7-day trial; Enterprise custom

Semrush AI Visibility Toolkit

Teams on Semrush

ChatGPT, Google AI Mode, Gemini; Semrush One adds Perplexity

AI Visibility Score + Prompt Research beside SEO data

99 (25 prompts); Semrush One from 199

Ahrefs Brand Radar

Competitive research

AI Overviews, AI Mode, ChatGPT, Perplexity, Gemini, Copilot, Claude

519M+ prompt index, no setup needed

199 for the index; own prompts from 50

Peec AI

Brands and agencies

ChatGPT, AI Mode, AI Overviews, Copilot, Gemini, Naver AI (3 active at a time); Perplexity, Claude and others on Enterprise

Visibility, position, sentiment, SoV, domain and URL sources

95 (50 prompts)

Otterly.AI

Small teams and agencies

ChatGPT, AI Overviews, Perplexity, Copilot; AI Mode, Gemini, Claude as paid add-ons

Lowest entry price, daily tracking, GEO audit

29 (15 prompts)

Scrunch

Persona tracking + an AI-ready site

ChatGPT, Claude, Gemini, Perplexity, AI Mode, AI Overviews, Meta

Persona benchmarking + Agent Experience Platform

300 (350 prompts, 3 personas)

AthenaHQ

Teams that want next actions

Starter: 11, incl. ChatGPT, Perplexity, AI Overviews, AI Mode, Gemini, Copilot, Claude, Grok, DeepSeek, Meta AI

Prompt volume estimates + actions

Free Essential; Starter 295 (3,600 credits)

Rankscale

Tight budgets, experiments

17+ on every plan, incl. ChatGPT, AI Overviews, AI Mode, Perplexity, Gemini, Claude, Copilot, Grok, DeepSeek

Credit-based pricing, query fan-out view

20 (17 billed yearly)

Goodie AI

Monitoring + optimisation + commerce

Core: 5; Pro: 8; Enterprise: up to 14

Optimization Actions, Content Studio, Agentic Commerce

295 (110 prompts)

Features, engine coverage and prices in this category change monthly. Prices are monthly list prices from each vendor's pricing page, checked on 31 October 2026; annual billing is usually 15–20% cheaper. Re-check before you buy or republish.

1. Profound

Profound is the deepest enterprise platform: up to nine engines on Enterprise, plus data most rivals lack, such as prompt volumes and AI crawler analytics.

  • Measures: Answer Engine Insights (visibility, citations, sentiment, and FactCheck for wrong claims); Prompt Volumes (how often topics are asked, with history and export); Agent Analytics (which AI bots crawl which pages).
  • Practical workflow:
    1. Start the free trial: 50 prompts, daily for 7 days, on ChatGPT, Gemini and AI Overviews. Use your highest-value category and comparison prompts.
    2. On Enterprise, load the full prompt set by bucket and region, and add 4–6 competitors.
    3. Connect Agent Analytics through its CDN integration or server-log ingestion.
    4. Export Citation Analytics: the domains engines trust in your category become your PR and content target list.
    5. Use Prompt Volumes to weight your prompt set toward what people actually ask.
  • Watch out: no published price beyond the trial; expect an enterprise contract.

2. Semrush AI Visibility Toolkit

Semrush is the easiest start if your SEO team already lives in it. The toolkit costs 99 USD a month per user, standalone or added to a plan, and is bundled in the Semrush One tiers.

  • Measures: Visibility Overview (AI Visibility Score), Brand Performance (share of voice, sentiment, key narratives), Prompt Tracking (daily), Prompt Research (volume, difficulty, intent), Competitor Research (where rivals are cited and you aren't), AI Search Site Audit.
  • Practical workflow:
    1. Set up the brand and competitors; read Brand Performance for SoV and narratives.
    2. Use Prompt Research to pick the 25 prompts the base plan tracks; add 50 more for 60 USD a month if needed.
    3. Run Competitor Research to list prompts where rivals get cited and you don't.
    4. Fix the issues AI Search Site Audit flags on the pages you want cited.
    5. Larger teams can look at Semrush Enterprise AIO, which adds a 289M+ prompt database, AI bot log-file analysis, GA4 and Adobe integration.
  • Watch out: Semrush's help pages confirm ChatGPT, Google AI Mode and Gemini for tracking; check your plan before counting on other engines.

3. Ahrefs Brand Radar

Brand Radar inverts the model: Ahrefs runs an index of 519M+ prompts and lets you search it for any brand, so you can benchmark competitors in minutes without writing prompts.

  • Measures: AI Visibility Index, AI share of voice, competitor benchmarking, and which pages and domains get cited (in Topics); Custom Prompts tracks your own prompts.
  • Practical workflow:
    1. Enter your brand plus 3–5 rivals and compare share of voice across engines.
    2. Look for topics where competitors are cited and you are not: this is your gap list.
    3. Open the cited pages for those gaps; they show the format engines prefer (lists, comparisons, review sites).
    4. Add Custom Prompts (from 50 USD a month) for bottom-funnel buyer questions the index may not cover.
  • Watch out: the pricing pages don't say whether a base Ahrefs plan is required; confirm before you buy.

4. Peec AI

Peec AI is a focused, prompt-based tracker with clean reporting, aimed at brands and agencies.

  • Measures: visibility, position, sentiment and share of voice, with separate Domains and URLs source reports, set per country.
  • Practical workflow:
    1. On Starter (95 USD, 50 prompts), choose the 3 engines your buyers use most.
    2. Tag prompts by bucket (category, comparison etc.) and review the URLs report weekly.
    3. Pull data through the API (Pro, 245 USD) or the Data Studio connector (Advanced, 495 USD) for client reporting.
  • Watch out: paid plans run only 3 engines at a time, and Perplexity and Claude are Enterprise-only.

5. Otterly.AI

Otterly.AI has the lowest entry price in this list: 29 USD a month for 15 prompts, tracked daily.

  • Measures: brand mentions, Average Brand Position, Brand Visibility Index, share of voice, domain ranking, link citations, GEO audit, and a Query Fan Out tool; Agent Analytics from Standard.
  • Practical workflow:
    1. Start with 15 high-value category and comparison prompts on Lite.
    2. Run the GEO audit and fix the flagged pages first.
    3. Use the Query Fan Out tool to see which searches your prompts trigger.
    4. Move to Standard (189 USD, 100 prompts) once the baseline is useful.
  • Watch out: AI Mode, Gemini and Claude cost extra on every plan.

6. Scrunch

Scrunch (now at scrunch.com) combines persona-based tracking with an Agent Experience Platform that serves AI bots a simplified, server-rendered version of your pages.

  • Measures: visibility, citations and competitors by topic, persona, model and region; Page Audits; AI agent traffic (GPTBot, ClaudeBot, PerplexityBot) and crawl errors.
  • Practical workflow:
    1. Define 3 personas on Starter (300 USD, 350 prompts), for example IT buyer, CFO, end user.
    2. Compare visibility by persona: brands often win with end users and vanish for executives.
    3. Check agent traffic and crawl errors for pages bots fail to read.
    4. Evaluate the Agent Experience Platform for those pages; humans and Google/Bing crawlers still get the normal site.
  • Watch out: the pricing page doesn't say which plans include the Agent Experience Platform.

7. AthenaHQ

AthenaHQ pairs tracking with an action layer: it estimates which prompts are asked most and suggests on-page and off-page actions to win them.

  • Measures: prompt and response analysis, sources, competitors, and prompt volume estimates; Enterprise adds forecasting with dollar-value estimates and a Recommendation Engine.
  • Practical workflow:
    1. Start on the free Essential plan (5 engines) to get a feel for the data.
    2. On Starter (295 USD, 3,600 credits, 1 credit = 1 AI response), sort prompts by estimated volume × your visibility gap.
    3. Work through the suggested actions, and use the content agent or the Shopify and Webflow integrations to publish.
    4. Re-measure the same prompts 3–4 weeks after each change.
  • Watch out: volume figures are estimates; use them to prioritise, not to forecast traffic.

8. Rankscale

Rankscale is the cheapest way to cover many engines: 17+ on every plan, from 20 USD a month on a credit-based model.

  • Measures: visibility score, rankings in answers, citations and sources, competitor analysis, Page Audits (AI readiness, bot crawlability), Query Fanouts and Prompt Research; sentiment from the Pro plan.
  • Practical workflow:
    1. Track your top 25 prompts across 3–4 engines for a cheap baseline.
    2. Use it to A/B test content: track one prompt cluster before and after a page change.
    3. Check Query Fanouts to see which searches your prompts trigger.
  • Watch out: credits run down fast with many prompts tracked often; Essentials (120 credits) is billed yearly only.

9. Goodie AI

Goodie is an all-in-one AEO platform that ties monitoring to optimisation, content and AI shopping visibility.

  • Measures: mentions, citations, sentiment and competitive share; prompt research and trending topics; AI agent analytics; attribution.
  • Practical workflow:
    1. On Core (295 USD, 110 prompts), baseline the 5 core engines.
    2. Turn gaps into work with Optimization Actions and Content Studio.
    3. For ecommerce, the Pro plan (999 USD) adds SKU-level visibility in AI shopping answers.
  • Watch out: Claude, Grok, Meta AI and DeepSeek are Enterprise-only.

How to choose in five minutes

  • Under 100 USD a month: Otterly.AI Lite (29), Rankscale (20) or Peec AI Starter (95), plus the DIY tracker below.
  • Already on Semrush or Ahrefs: start there; add Peec AI or Otterly.AI if you need your own prompts with cleaner reporting.
  • Agency with many clients: Peec AI or Otterly.AI.
  • Persona-heavy or enterprise: Scrunch from 300 USD, or Profound on contract; run a 2-week bake-off on the same 50 prompts.
  • Want recommended actions, not just numbers: AthenaHQ or Goodie AI.
  • Don't know which questions to track yet: start with WhatBuyersAsk (Step 1) to build the prompt set and find answer gaps, then pick a tracker.

Run any bake-off on an identical prompt set. Tools disagree, sometimes by 20+ points, because of sampling, location, and whether they query the API or the consumer app. Ask each vendor how it collects answers, and pick the one whose numbers match your own manual checks.

Step 3: Build your own tracker in Python

A DIY tracker costs a few dollars of API calls per run and gives you raw answers you own, which is the best way to sanity-check any vendor's numbers. Two scripts do the job: one collects answers, one scores them.

One caveat first: API answers are not what a logged-in user sees in the consumer app. In a 2026 preprint, Google results plus OpenAI's API together found only 26–28% of the pages ChatGPT cited, and about half of the sites. Treat the DIY tracker as a consistent benchmark, not a replica of every user's screen. Use web-grounded models (Perplexity Sonar, Gemini with Google Search, OpenAI with web search) so answers include citations.

Script 1: collect answers

# collect.py — run every prompt N times on each engine, save raw answers to JSONL
# pip install openai anthropic google-genai requests
import csv, json, os, time, datetime, requests
from openai import OpenAI
from anthropic import Anthropic
from google import genai
from google.genai import types

RUNS_PER_PROMPT = 3
OUT = f"answers_{datetime.date.today()}.jsonl"

oai = OpenAI()          # OPENAI_API_KEY
ant = Anthropic()       # ANTHROPIC_API_KEY
gem = genai.Client()    # GEMINI_API_KEY

def ask_openai(prompt):
    r = oai.responses.create(model=os.getenv("OPENAI_MODEL", "gpt-5"),
                             tools=[{"type": "web_search"}], input=prompt)
    urls = [a.url for item in r.output if item.type == "message"
            for c in item.content for a in (getattr(c, "annotations", None) or [])
            if getattr(a, "url", None)]
    return r.output_text, urls

def ask_perplexity(prompt):
    r = requests.post("https://api.perplexity.ai/chat/completions",
        headers={"Authorization": f"Bearer {os.environ['PERPLEXITY_API_KEY']}"},
        json={"model": "sonar", "messages": [{"role": "user", "content": prompt}]},
        timeout=120).json()
    return r["choices"][0]["message"]["content"], r.get("citations", [])

def ask_gemini(prompt):
    r = gem.models.generate_content(model=os.getenv("GEMINI_MODEL", "gemini-2.5-flash"),
        contents=prompt,
        config=types.GenerateContentConfig(tools=[types.Tool(google_search=types.GoogleSearch())]))
    meta = r.candidates[0].grounding_metadata
    urls = [c.web.uri for c in (meta.grounding_chunks or [])] if meta else []
    return r.text, urls

def ask_claude(prompt):
    r = ant.messages.create(model=os.getenv("CLAUDE_MODEL", "claude-sonnet-5-5"),
        max_tokens=1500,
        tools=[{"type": "web_search_20250305", "name": "web_search", "max_uses": 3}],
        messages=[{"role": "user", "content": prompt}])
    text = "".join(b.text for b in r.content if b.type == "text")
    urls = [c.url for b in r.content if b.type == "text"
            for c in (getattr(b, "citations", None) or []) if getattr(c, "url", None)]
    return text, urls

ENGINES = {"chatgpt": ask_openai, "perplexity": ask_perplexity,
           "gemini": ask_gemini, "claude": ask_claude}

with open("prompts.csv") as f, open(OUT, "a") as out:
    for row in csv.DictReader(f):
        for engine, ask in ENGINES.items():
            for run in range(RUNS_PER_PROMPT):
                try:
                    text, urls = ask(row["prompt"])
                except Exception as e:
                    print("ERR", engine, row["id"], e); continue
                out.write(json.dumps({"date": str(datetime.date.today()), "engine": engine,
                    "run": run, **row, "answer": text, "citations": urls}) + "\n")
                time.sleep(1)
print("Saved", OUT)

Model names change often; set them through the environment variables rather than editing the code. Check each provider's docs for the current web-search tool name.

Script 2: score the answers

# score.py — compute mention rate, SoV, average position and citation rate
import json, re, sys
from collections import defaultdict
from urllib.parse import urlparse

BRANDS = {  # canonical name -> aliases to match
    "YourBrand":   ["yourbrand", "your brand", "yourbrand.com"],
    "CompetitorA": ["competitora"],
    "CompetitorB": ["competitorb", "comp b"],
}
OWN_DOMAIN = "yourbrand.com"

def first_index(text, aliases):
    hits = [m.start() for a in aliases for m in re.finditer(r"\b" + re.escape(a) + r"\b", text)]
    return min(hits) if hits else None

rows = [json.loads(l) for l in open(sys.argv[1])]
stats = defaultdict(lambda: defaultdict(float))

for r in rows:
    text = r["answer"].lower()
    seg = (r["engine"], r["bucket"])
    stats[seg]["answers"] += 1
    found = {b: first_index(text, a) for b, a in BRANDS.items()}
    order = sorted((i, b) for b, i in found.items() if i is not None)
    for rank, (_, b) in enumerate(order, 1):
        stats[seg][f"mentions:{b}"] += 1
        if b == "YourBrand":
            stats[seg]["position_sum"] += rank
    domains = {urlparse(u).netloc.replace("www.", "") for u in r["citations"]}
    if any(d.endswith(OWN_DOMAIN) for d in domains):
        stats[seg]["cited"] += 1

print(f"{'engine':<11}{'bucket':<12}{'mention%':>9}{'SoV%':>7}{'avgPos':>8}{'cite%':>7}")
for (engine, bucket), s in sorted(stats.items()):
    mine = s["mentions:YourBrand"]
    total = sum(v for k, v in s.items() if k.startswith("mentions:"))
    print(f"{engine:<11}{bucket:<12}"
          f"{100 * mine / s['answers']:>8.0f}%"
          f"{(100 * mine / total if total else 0):>6.0f}%"
          f"{(s['position_sum'] / mine if mine else 0):>8.1f}"
          f"{100 * s['cited'] / s['answers']:>6.0f}%")

Run it as python score.py answers_2026-10-31.jsonl. You get one line per engine and intent bucket, which is exactly the segmentation the metrics framework asks for.

Optional: sentiment and accuracy with an LLM judge

Keyword matching cannot tell "YourBrand is great for agencies" from "avoid YourBrand". Add a judge pass that reads each answer that mentions you and returns structured labels:

# judge.py — label sentiment and factual accuracy for answers that mention you
import json, sys
from anthropic import Anthropic

client = Anthropic()
FACTS = "YourBrand: starts at 12 USD per user/month, has SOC 2 Type II, integrates with Slack and HubSpot."

for line in open(sys.argv[1]):
    r = json.loads(line)
    if "yourbrand" not in r["answer"].lower():
        continue
    msg = client.messages.create(model="claude-haiku-5-5", max_tokens=200,
        messages=[{"role": "user", "content":
            f"Ground truth: {FACTS}\n\nAnswer:\n{r['answer']}\n\n"
            'Return JSON only: {"sentiment": "positive|neutral|negative", '
            '"accurate": true|false, "errors": ["..."]} about YourBrand.'}])
    print(json.dumps({"id": r["id"], "engine": r["engine"], **json.loads(msg.content[0].text)}))

The errors list is gold: every wrong price, missing feature or outdated claim is a page to fix or a source to correct.

Schedule the collector weekly (cron, GitHub Actions or a cloud scheduler) and append results to a sheet or BigQuery table to build your trend line.

Step 4: Measure AI referral traffic and AI crawlers

Visibility tools tell you what engines say; your own analytics tell you whether it produces visits and whether engines can read your site at all. Set up both in under an hour.

GA4: an AI traffic channel

In GA4, go to Admin → Data display → Channel groups, copy the default group, and add a channel named "AI Assistants" above Referral with the condition Source matches regex:

^(.*\.)?(chatgpt\.com|chat\.openai\.com|perplexity\.ai|gemini\.google\.com|bard\.google\.com|copilot\.microsoft\.com|edgeservices\.bing\.com|claude\.ai|meta\.ai|grok\.com|deepseek\.com|chat\.mistral\.ai|you\.com|phind\.com)$

Then build an Exploration with source, landing page, engaged sessions and key events. Three reports matter most:

  • AI sessions by source, monthly: your outcome trend line.
  • Landing pages from AI: the pages engines send people to; compare with the citation reports from your tool.
  • Conversion rate, AI vs organic: AI visitors often arrive further along, so a smaller channel can convert better.

Two blind spots to report honestly: Google AI Overviews and AI Mode clicks arrive as ordinary google / organic, and many app clicks arrive with no referrer at all. GA4 undercounts AI influence, so pair it with a "How did you hear about us?" field on forms that includes "ChatGPT / AI assistant" as an option.

Server logs: which AI bots read your site

If AI crawlers cannot fetch a page, it will not be cited. This script parses standard Nginx or Apache combined logs and groups AI bot hits by purpose and by URL.

# ai_bots.py — count AI crawler hits by bot, purpose, status code and URL
# usage: python ai_bots.py /var/log/nginx/access.log
import re, sys
from collections import Counter

BOTS = {
    "GPTBot": "training", "OAI-SearchBot": "search index", "ChatGPT-User": "user fetch",
    "ClaudeBot": "training", "Claude-SearchBot": "search index", "Claude-User": "user fetch",
    "PerplexityBot": "search index", "Perplexity-User": "user fetch",
    "Googlebot": "search index", "bingbot": "search index",
    "Applebot": "search index", "Meta-ExternalAgent": "training",
    "Amazonbot": "training", "CCBot": "training", "Bytespider": "training",
    "DuckAssistBot": "user fetch", "MistralAI-User": "user fetch",
}
LINE = re.compile(r'"(?:GET|HEAD) (?P<path>\S+) [^"]+" (?P<status>\d{3}) .*"(?P<ua>[^"]*)"$')

by_bot, by_status, by_path = Counter(), Counter(), Counter()
for line in open(sys.argv[1], errors="ignore"):
    m = LINE.search(line.strip())
    if not m:
        continue
    bot = next((b for b in BOTS if b.lower() in m["ua"].lower()), None)
    if not bot:
        continue
    by_bot[(bot, BOTS[bot])] += 1
    by_status[(bot, m["status"])] += 1
    by_path[m["path"].split("?")[0]] += 1

print("Hits by bot")
for (bot, purpose), n in by_bot.most_common():
    print(f"  {bot:<20}{purpose:<14}{n:>7}")
print("\nNon-200 responses (fix these first)")
for (bot, status), n in sorted(by_status.items()):
    if status != "200":
        print(f"  {bot:<20}{status:<6}{n:>7}")
print("\nTop 20 URLs fetched by AI bots")
for path, n in by_path.most_common(20):
    print(f"  {n:>6}  {path}")

How to read the output:

  • "user fetch" hits (ChatGPT-User, Claude-User, Perplexity-User) mean a real person's question just pulled your page into an answer. Treat them as the closest log-level proxy for AI citations.
  • 403, 429 or 5xx for AI bots usually mean a WAF, CDN bot rule or rate limit is blocking them. Check Cloudflare's AI bot settings and your robots.txt.
  • Key pages missing from the top 20 (pricing, comparison, product pages) are pages engines cannot see. Check they are server-rendered, not hidden behind JavaScript, and linked from your sitemap.

User-agent strings can be spoofed; for strict reporting, verify bots against the IP ranges each provider publishes.

Step 5: Turn measurement into a monthly operating rhythm

Measurement only pays off as a loop: measure, diagnose the gaps, act on content and sources, then re-measure the same prompts. Run it weekly for data and monthly for decisions.

AI visibility measurement loop

The loop only closes if the prompt set stays fixed between the first measure and the re-measure.

The one-page dashboard

Combine your tool export, the DIY tracker and GA4 in Looker Studio, a sheet or your BI tool. Keep it to five tiles:

  1. AI Visibility Score this month vs last, by engine
  2. Share of voice vs top 3 competitors, by intent bucket
  3. Citation rate and top cited URLs (yours and competitors')
  4. Accuracy errors open, from the judge script or tool alerts
  5. AI referral sessions and conversions from GA4

Cadence

What to do

Owner

Daily or weekly

Tool collection runs; DIY tracker runs on a schedule

Automated

Weekly

Scan for new competitors, sudden drops, accuracy errors

SEO / content lead

Monthly

Report the 5 tiles; pick 3–5 prompt clusters to work on

Marketing lead

Quarterly

Refresh the prompt set; re-run tool bake-off if needed

Marketing lead

A 30-day plan from zero to baseline

  1. Days 1–5, set up: build the prompt set, set up the GA4 channel, run the log script, start one tool trial.
  2. Days 6–12, baseline: run 3–5 samples per prompt per engine; record the seven metrics by bucket.
  3. Days 13–20, diagnose: list prompts where competitors appear and you don't; list the domains cited in those answers; list accuracy errors.
  4. Days 21–28, act: ship fixes for the top 3 clusters (ideas below).
  5. Day 30, report: publish the baseline dashboard and the plan; re-measure the same clusters 3–4 weeks after each change.

Ideas that move the numbers

Each idea maps to a gap the measurements reveal:

  • Low mention rate on category prompts → get onto the pages engines cite. Pull the top cited domains for those prompts (review sites, "best X" listicles, Reddit threads, YouTube) and pursue inclusion, reviews and genuine community answers there.
  • Competitors win comparison prompts → publish honest comparison pages. "[You] vs [Competitor]" and "alternatives to [Competitor]" pages, with tables and clear "best for" verdicts, are heavily cited.
  • Mentioned but rarely cited → make pages quotable. Put a direct, 40–60 word answer under each question heading; use tables, lists and specific numbers; add FAQ and Product schema; show an updated date.
  • Accuracy errors → fix the source of truth. Update pricing, feature and about pages; align G2, Capterra, Crunchbase, LinkedIn and Wikipedia/Wikidata where relevant; engines repeat what the web agrees on.
  • Bots blocked or key pages unfetched → fix access. Allow search and user-fetch bots in robots.txt and your CDN, server-render key pages, keep the sitemap clean.
  • Weak on problem prompts → publish original data. Surveys, benchmarks and calculators earn citations that generic blog posts don't.
  • Visible but not converting → fix the landing pages AI sends traffic to. These visitors arrive with a specific question; answer it at the top and offer a clear next step.

Common mistakes, and where to start

Most AI visibility programmes fail on method, not tooling. Avoid these six:

  • Tracking only brand prompts. You will look great and learn nothing. Category and problem prompts are where buyers choose.
  • Single-run screenshots. Answers vary run to run; always report averages over several samples.
  • Changing prompts every month. It breaks the trend line. Refresh quarterly and keep a stable core set.
  • Treating one tool as truth. Validate any tool against manual checks and the DIY tracker.
  • Ignoring accuracy. Being named with the wrong price or a missing feature can cost more than not being named.
  • Reporting visibility without outcomes. Tie it to AI referral sessions, self-reported attribution and pipeline.

Start small this week: write 30 real buyer prompts, run them through the DIY tracker, set up the GA4 channel, and trial one tool from the shortlist. In 30 days you will have a baseline, a gap list and the first fixes shipped — which puts you ahead of most of your category.

Sources

Vendor pages checked on 31 October 2026:

ChatGPT retrieval research:

WhatBuyersAsk

Practical research for agencies and B2B teams. Understand what buyers ask, find answer gaps and build more useful content.

Put better answers to work.

See what your buyers ask, find the answer gaps and plan your next move.

Get started