Skip to content
python script for improving ai visibility tracking prompts

Improving your AI Visibility Tool Prompts

Home > Blog > AI > Improving your AI Visibility Tool Prompts

AI search is conversational. Your starting query is the entry point — the follow-up prompts are where brand visibility is won or lost in the AI funnel. This framework uses Google Search Console data to identify the most likely entry-point queries for your brand or product, then uses People Also Ask as a surrogate for real AI follow-up prompts. This effectively gives you a ready-made prompt cluster structure for tools like Profound and Peec.

Why Should You Care About Improving Your AI Visibility Tool Tracked Prompts?

Tools like Profound and Peec track whether your brand appears in AI-generated answers, but the quality of that tracking depends entirely on the quality of the prompts you feed them. Most teams input their target keywords and stop there. Some rely on LLM-generated prompts that sit square in the middle of the Uncanny Valley. And still more marketers are forgetting that LLMs aren’t SERPs! They’re a conversation and there’s typically more to them than a simple ask and answer. All of this misses how AI search and LLM chat interfaces actually work.

If you aren’t tracking the right prompts, how can you ever know how visible you actually are or what you should be focused on to improve that visibility? To prevent going on a rant, I’ll refer you to another post that speaks to the issue of conversational AI tracking.

Here’s some good news: The solution is pretty straightforward. GSC tells you which informational queries you already rank for. PAA tells you exactly how users continue a conversation on that topic. Combined, they give you a query cluster that mirrors real AI user behavior. It ain’t perfect, but it’s all we’ve got. For now.

Example of People Also Ask questions (PAA's). You can use these for improved AI visibility tracking.

Low CTR Is a Signal, Not a Problem

Traditionally, a low CTR at a high ranking position is a problem. In this approach, it’s a signal. When your page ranks in positions 1–15 but organic CTR is significantly below benchmark, it usually means one of four things:

  • AI Overviews are answering the query directly in the SERP, removing click incentive
  • PAA boxes are satisfying (or redirecting) user intent before a site visit
  • The query is informational enough that users scan the SERP answer and move on
  • SERP features are distracting from the click

All four conditions are correlated with queries AI models are likely to be prompted with. These are the queries you need to track in AI tools most urgently. You can vet this by looking at your GSC Queries data YoY. If your clicks fell off a click, congrats! That query is probably now being answered by AIOs or other LLMs. So let’s track it!


Process Overview

  1. Export your GSC query data as a CSV (90+ days, Web type)
  2. Run the intent classification script to label each query
  3. Filter to starting point queries using the four criteria: informational intent, high impressions, low CTR, position ≤20
  4. Manually review the top 30–50 results and finalize your seed list
  5. Collect PAA questions for each seed query (manually or via AlsoAsked/Ahrefs)
  6. Filter out low-signal PAA questions and build your prompt clusters (1 seed + 4–6 follow-ups each)
  7. Enter your clusters into Profound or Peec and set your AI model targets

Step 1: Export Your GSC Query Data

You need the raw query performance data from Google Search Console — every query Google has seen your site receive impressions for, with click, impression, CTR, and average position data. If you manage a large site, filter to your informational content URLs first (blog, resources, guides) before exporting queries. This removes transactional page noise and speeds up classification.

  1. Open Google Search Console → Performance → Search results
  2. Set the date range to at least 90 days (6–12 months is better for lower-volume informational queries. Be mindful of seasonality, site changes, algo update impacts, etc. Noisy data = noisy results.)
  3. Filter by Web search type — exclude Image, Video, and News unless relevant for your brand.
  4. Click Export → Download CSV
  5. Rename the file to gsc_queries.csv and place it in your working directory

Once that’s done, we move on to the next step.

GSC exports the query column as “Top queries,” not “Query.” The script handles this automatically. CTR may also export as a percentage string like 4% — the script normalizes this to a decimal.


Step 2: Classify Query Intent

Intent classification sorts your queries into four buckets. The goal isn’t perfect accuracy — it’s a fast, auditable way to isolate informational queries from navigational, transactional, and commercial-investigation queries.

Intent TypeWhat it signalsAI tracking priorityExample
NavigationalUser is looking for your brand or a specific URLLow“[Brand] login”
TransactionalUser intends to take an actionLow“buy [product]”
Commercial InvestigationUser is comparing optionsMedium“best [tool] for [use case]”
InformationalUser wants to understand somethingHigh — AI entry points“how to [do X]”

The script uses keyword pattern matching — deliberately simple. It works well enough for the volume of queries in a typical GSC export, runs in seconds, and is fully auditable. Classification order matters: navigational keywords are checked first, then transactional, then commercial, then informational.

Why not use NLP?

For a production pipeline you could use a BERT model or an LLM API for classification. But for this use case, keyword matching gets you 85–90% accuracy on a typical GSC dataset in seconds, without dependencies or API costs. Start here and upgrade only if you need to. Also worth noting that we’re working in a table and LLMs aren’t exactly reliable when it comes to working in tabular data. I default to Python or SQL when and where I can.

import re
BRAND_TERMS = ["your brand", "yourbrand", "yourproduct"]  # ← edit this
TRANSACTIONAL_TERMS = [
    "buy", "price", "pricing", "cost", "cheap", "discount",
    "order", "purchase", "promo", "coupon", "deal", "hire",
    "quote", "near me", "book", "subscribe", "free trial",
]
COMMERCIAL_TERMS = [
    "best", " vs ", "versus", "review", "compare",
    "top ", "alternative", "alternatives", "worth it", "pros and cons",
]
INFORMATIONAL_TERMS = [
    "how ", "what ", "why ", "when ", "who ", "where ",
    "which ", "guide", "tutorial", "example", "tips",
    "ways to", "learn", "explain", "meaning", "definition",
    "what is", "what are", "how to", "difference between",
    "does ", "is it",
]
def classify_intent(query):
    q = query.lower()
    if any(t in q for t in BRAND_TERMS):        return "Navigational"
    if any(t in q for t in TRANSACTIONAL_TERMS):  return "Transactional"
    if any(t in q for t in COMMERCIAL_TERMS):    return "Commercial Investigation"
    if any(t in q for t in INFORMATIONAL_TERMS):  return "Informational"
    return "Unclear"
def is_question_format(query):
    pattern = r'^(how|what|why|when|who|where|which|can|does|is|are|will|should|do|did)\b'
    return bool(re.match(pattern, query.strip(), re.IGNORECASE))

Step 3: Identify Your Starting Point Queries

A “starting point query” is the first thing a user types when beginning an AI conversation on a topic you care about. You want queries that are informational, have real volume, show CTR suppression from SERP features, and are within your ranking range.

Informational intentAI excels at “how” and “what” questions. These are the entry points to AI conversations.
High impressionsVolume confirms the topic matters. Low-volume queries may not be in AI training corpora.
Low CTR vs. positionThe gap between rank and clicks signals SERP features are already intercepting intent.
Position 1–20You need to rank for a query to have a reasonable chance of brand inclusion in AI answers.

The CTR Gap Method

Rather than an absolute CTR threshold, compare each query’s CTR against the expected CTR for its position. (Note: check the date of your CTR curve table. If it’s older than 2025, stop and use the updated table here. CTR ain’t what it used to be.) A query at position 3 with 1% CTR (expected ~10%) is a much stronger AI-tracking candidate than a query at position 12 with 1% CTR (expected ~2%). The script uses a simple median threshold to get started.

import pandas as pd
df = pd.read_csv("gsc_queries.csv")
df.columns = df.columns.str.strip()
# Normalize CTR: GSC exports as "4%" not 0.04
if df["CTR"].dtype == object:
    df["CTR"] = df["CTR"].str.replace("%", "").astype(float) / 100
if "Top queries" in df.columns:
    df = df.rename(columns={"Top queries": "Query"})
df["intent"]      = df["Query"].apply(classify_intent)
df["is_question"] = df["Query"].apply(is_question_format)
median_ctr         = df["CTR"].median()
median_impressions = df["Impressions"].median()
starting_points = df[
    (df["intent"] == "Informational") &
    (df["Impressions"] >= median_impressions) &
    (df["CTR"] < median_ctr) &
    (df["Position"] <= 20)
].copy()
# Priority score: rewards volume, question format, and large CTR gap
starting_points["priority_score"] = (
    starting_points["Impressions"] *
    (starting_points["is_question"].astype(int) + 1) *
    (1 / starting_points["CTR"].clip(lower=0.001))
)
starting_points = starting_points.sort_values("priority_score", ascending=False)
starting_points.to_csv("starting_point_queries.csv", index=False)
print(f"Found {len(starting_points)} starting point queries")

What to do next

Take the top 20–40 starting point queries and manually review them. Remove any that are too niche, geo-specific, or whose intent you’d reclassify after reading. What remains is your seed list for PAA collection.

Step 4: Collect PAA Questions as Surrogate Follow-Up Prompts

People Also Ask boxes are Google’s curated signal of how a user’s search intent expands after an initial query. How they work is pretty interesting, you should read this old Bill Slawski piece about it. In an AI search context, they’re a good proxy for the follow-up prompts a user sends after getting an initial AI answer.

Why PAA Works as a Surrogate

Google’s PAA algorithm is built on actual search behavior. Real users searching for a topic, then pivoting to related questions. That’s essentially the same pattern as an AI conversation.

If you don’t have the time to take an SEO history side quest, here’s the short version: Google’s PAA algorithm is built on actual search behavior. Real users searching for a topic, then pivoting to related questions. That’s essentially the same pattern as an AI conversation. PAA questions represent a crowd-sourced map of how a conversation naturally branches. They’re not perfect, but they’re much better than guessing your own follow-up prompts.

So let’s look at how we’re going to rope those into our process for building out our AI Visibility tool prompts for tracking.

Manual Collection

This one’s best if you’re focused on a single page or single intent and a cluster of pages on your site.

  1. Search each starting point query in an incognito window to remove personalization
  2. Copy the PAA questions that appear above the fold (usually 4 initial questions)
  3. Click each PAA question to expand it, causing Google to surface more related questions
  4. Collect 4–8 PAA questions per starting query
  5. Log them in a spreadsheet: one starting query per row, PAA questions in columns

If you’re a SaaS company, Insurance company, or any other business that has a relatively small number of key business landing pages, the manual method is a pretty safe bet if not modestly time consuming. But quality is worth it, right?

If you’re running an e-commerce site, a large enterprise SaaS website, or just have too many landing pages to work through, I’ve got some easier semi-automated approaches to getting the data you need.

Semi-Automated Options

ToolHow It Works
AlsoAsked.comDedicated PAA scraping, full PAA tree CSV export
SEMRush Keyword MagicQuestions filter shows PAA-style questions
Ahrefs Keyword ExplorerFilter by “Questions” in parent topic view
SERP API + PythonProgrammatic SERP scraping, structured PAA JSON per query

Which PAA to prioritize

Prioritize PAA questions beginning with “what,” “how,” and “why”. These produce substantive AI answers where specific tools, methodologies, or brands are commonly mentioned. “Is,” “does,” and “can” questions tend to produce shorter, binary AI answers where brand mentions are less common, but that’s not a hard and fast rule.

Step 5: Build Prompt Clusters for Your AI Visibility Tools

A prompt cluster is the core unit of AI visibility tracking. It consists of one starting-point query (the seed prompt) paired with 3–6 PAA-derived follow-up prompts that simulate a real AI conversation thread around a topic.

SEED PROMPTHow do you create a content marketing strategy?
Follow Up 1What should be included in a content marketing plan?
Follow Up 2How do you measure content marketing ROI?
Follow Up 3What tools do content marketers use?
Follow Up 4What is the difference between Buffer and Hootsuite?
Follow Up 5How often should you publish content for marketing?

That’s it. Load your prompts into the tracking tool of your choice. Tagging your prompts (if your tool allows for individual prompt tagging) is highly recommended. You’ll want to assign all follow-up prompts to a group along with the parent so you can get visibility for the whole “thread”.

Advanced Considerations

Prompt Maintenance: Refreshing Your Clusters Over Time

PAA questions shift as Google’s understanding of a topic evolves. Re-run this workflow quarterly and compare new PAA questions against your existing clusters. New PAA questions that consistently appear are signals of emerging conversation threads worth adding to your tracking. You can learn more about PAAs here. It’s good to be well-informed.

Adding Commercial Investigation Queries

Once your informational clusters are stable, extend the pipeline to commercial investigation starting queries like “best [category] tool” searches are often the primary AI entry point in B2B SaaS and professional services verticals.

Full Script: GSC → Starting Point Queries

Complete runnable script combining both steps. Save as gsc_to_starting_queries.py in the same directory as your gsc_queries.csv file. Only dependency is pandas:

"""
GSC → AI Visibility Starting Point Query Finder
Input:  gsc_queries.csv
Output: starting_point_queries.csv + intent_classified_all.csv
Usage:  python gsc_to_starting_queries.py
"""
import pandas as pd
import re, sys
# ── CONFIGURATION ──────────────────────────────────────────────
BRAND_TERMS         = ["your brand name", "yourbrand", "your product"]
TRANSACTIONAL_TERMS = ["buy", "price", "pricing", "cost", "how much", "cheap",
                       "discount", "order", "purchase", "hire", "quote",
                       "near me", "book", "subscribe", "free trial", "sign up"]
COMMERCIAL_TERMS    = ["best", " vs ", "versus", "review", "compare", "top ",
                       "alternative", "alternatives", "worth it", "pros and cons"]
INFORMATIONAL_TERMS = ["how ", "what ", "why ", "when ", "who ", "where ",
                       "which ", "guide", "tutorial", "example", "tips",
                       "ways to", "learn", "explain", "meaning", "definition",
                       "what is", "what are", "how to", "difference between",
                       "does ", "is it", "overview", "step by step"]
QUESTION_PATTERN    = re.compile(
    r'^(how|what|why|when|who|where|which|can|does|is|are|will|should|do|did)\b',
    re.IGNORECASE)
IMPRESSION_PERCENTILE = 50
MAX_POSITION          = 20
CTR_PERCENTILE        = 50
# ──────────────────────────────────────────────────────────────
def classify_intent(query):
    q = query.lower()
    if any(t in q for t in BRAND_TERMS):        return "Navigational"
    if any(t in q for t in TRANSACTIONAL_TERMS):  return "Transactional"
    if any(t in q for t in COMMERCIAL_TERMS):    return "Commercial Investigation"
    if any(t in q for t in INFORMATIONAL_TERMS):  return "Informational"
    return "Unclear"
def is_question_format(query):
    return bool(QUESTION_PATTERN.match(query.strip()))
def load_gsc_csv(filepath):
    df = pd.read_csv(filepath)
    df.columns = df.columns.str.strip()
    df = df.rename(columns={"Top queries": "Query", "top queries": "Query"})
    required = ["Query", "Impressions", "CTR", "Position"]
    missing = [c for c in required if c not in df.columns]
    if missing:
        print(f"Error: missing columns: {missing}"); sys.exit(1)
    if df["CTR"].dtype == object:
        df["CTR"] = df["CTR"].str.replace("%", "", regex=False).astype(float) / 100
    df["Query"] = df["Query"].fillna("").astype(str).str.strip()
    return df[df["Query"] != ""]
def main():
    df = load_gsc_csv("gsc_queries.csv")
    print(f"{len(df):,} queries loaded")
    df["intent"]      = df["Query"].apply(classify_intent)
    df["is_question"] = df["Query"].apply(is_question_format)
    print(df["intent"].value_counts().to_string())
    imp_t = df["Impressions"].quantile(IMPRESSION_PERCENTILE / 100)
    ctr_t = df["CTR"].quantile(CTR_PERCENTILE / 100)
    out = df[
        (df["intent"] == "Informational") &
        (df["Impressions"] >= imp_t) &
        (df["CTR"] <= ctr_t) &
        (df["Position"] <= MAX_POSITION)
    ].copy()
    out["priority_score"] = (
        out["Impressions"] *
        (out["is_question"].astype(int) + 1) *
        (1 / out["CTR"].clip(lower=0.001))
    ).round(0)
    out = out.sort_values("priority_score", ascending=False)
    out.to_csv("starting_point_queries.csv", index=False)
    df.to_csv("intent_classified_all.csv", index=False)
    print(f"Done — {len(out):,} starting point queries saved.")
if __name__ == "__main__":
    main()

Did you Get Better Results?

Did your AI Visibility scores change after you did this? Are you able to see things you couldn’t see before? Did it help inform your strategy? Let me know!