BLOG

How to Check Your Brand’s AI Visibility Using Python

AI SEO
Brand Visibility
GEO
Python for SEO
ChatGPT
LLM Optimization

Google is no longer the only place people search. Millions now ask ChatGPT, Claude, Gemini, and Perplexity for recommendations. If your brand isn’t showing up in those answers, you’re invisible to a growing segment of your audience. Here’s how I built a simple tracker to measure it.

Why AI Visibility Matters for SEO in 2025

Traditional SEO tracks keyword rankings on Google. But when someone asks ChatGPT “Who are the best online Hindi class providers?” — does your brand get mentioned? That’s AI Visibility, and it’s becoming a critical metric for every digital marketer.

This is now being called GEO — Generative Engine Optimization. Just like we optimised for search engines, we now need to optimise for large language models (LLMs). As an SEO professional, I built a lightweight Python script to audit exactly this — and I’m sharing the full approach here.

“If your brand isn’t mentioned when an AI answers your customer’s question, you’ve lost that touchpoint — silently.”

What This Script Does

The script sends a set of targeted prompts to the OpenAI API (GPT model) — the same prompts your potential customers might type — and logs the full responses. It then checks whether your brand name appears in those responses and exports everything to an Excel file for analysis.

Think of it as a rank tracker — but for AI answers.

Prerequisites: What You Need

1Python 3.9+ installed on your machine
2An OpenAI API key — get one at platform.openai.com
3Install required libraries by running this in your terminal:

pip3 install openai pandas openpyxl

Step 1: Set Up Your Project Folder

Open your terminal and create a dedicated folder for this project:

mkdir ~/Documents/ai-visibility-tracker
cd ~/Documents/ai-visibility-tracker
touch tracker.py
open -e tracker.py

This creates a new directory, navigates into it, creates your Python file, and opens it in TextEdit for editing.

Step 2: The Complete Tracker Script

Paste this into your tracker.py file. Replace YOUR_API_KEY_HERE with your actual OpenAI key, and update the brand name and prompts to match your business:

import openai
import pandas as pd
import datetime

# ── Configuration ─────────────────────────────────────────
openai.api_key = "YOUR_API_KEY_HERE"
client = openai.OpenAI(api_key=openai.api_key)

BRAND_NAME = "wizmantra"   # lowercase for case-insensitive matching

# ── Prompts to test (customise these for your brand) ──────
prompts = [
    "What is WizMantra?",
    "Who are the top online English class providers?",
    "Tell me about Hindi classes in the UAE.",
    "Which companies offer Sanskrit language courses online?"
]

# ── Main tracking loop ────────────────────────────────────
records = []

for prompt in prompts:
    try:
        response = client.chat.completions.create(
            model="gpt-3.5-turbo",      # switch to "gpt-4" if available
            messages=[{"role": "user", "content": prompt}],
            temperature=0.7
        )
        answer = response.choices[0].message.content

        # Check if brand is mentioned in the AI's response
        brand_visible = "Yes" if BRAND_NAME in answer.lower() else "No"

        records.append({
            "date":          datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
            "prompt":        prompt,
            "response":      answer,
            "brand_visible": brand_visible
        })

    except Exception as e:
        records.append({
            "date":          datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
            "prompt":        prompt,
            "response":      f"Error: {e}",
            "brand_visible": "Error"
        })

# ── Export results to Excel ───────────────────────────────
df = pd.DataFrame(records)
df.to_excel("ai_visibility_log.xlsx", index=False)

print("✅ Done! Results saved to ai_visibility_log.xlsx")

Step 3: Run the Script

Save the file, then go back to your terminal and run:

python3 tracker.py

You’ll see: ✅ Done! Results saved to ai_visibility_log.xlsx

Open the Excel file — it will look something like this:

Date Prompt Response (truncated) Brand Visible
2026-01-06 10:49 What is WizMantra? WizMantra is an online language learning platform… Yes
2026-01-20 11:01 Who are the top online English class providers? Some popular platforms include Coursera, Preply… No
2026-02-18 12:46 Tell me about Hindi classes in the UAE. Several institutes offer Hindi classes in the UAE… No
2026-02-18 12:47 Which companies offer Sanskrit language courses online? WizMantra is one platform that offers Sanskrit… Yes

How to Interpret Your Results

The Brand Visible column is your core metric. Here’s how to think about it:

  • Direct brand prompts (e.g. “What is WizMantra?”) should almost always return “Yes”. If not, your brand has zero footprint in the AI’s training data — a serious signal.
  • Category prompts (e.g. “top online English class providers”) showing “No” means competitors are capturing those AI-generated recommendations instead of you.
  • Run this script monthly to track improvements over time as you build more content and citations.
💡 Pro Tip: The prompts you choose matter enormously. Think like your customer — what would they literally type into ChatGPT? Use your keyword research data to inform your AI visibility prompts. The overlap between SEO keyword intent and LLM prompt intent is your goldmine.

How to Improve Your AI Visibility (GEO)

Once you know where you’re invisible, here’s how to fix it:

  • Build authoritative content — LLMs are trained on the web. The more high-quality, well-cited content exists about your brand, the more likely it surfaces.
  • Get mentioned on third-party sites — Wikipedia, industry directories, review platforms, and news sites all feed AI training data.
  • Use structured data (Schema markup) — Helps AI systems understand your brand’s entity clearly.
  • Answer specific questions — Write detailed FAQ and “best of” style content that mirrors how users phrase questions to AI.
  • Build brand signals — Consistent NAP (Name, Address, Phone), social profiles, and press coverage all build brand entity strength.

Scaling This Further

This script is a solid foundation. Here’s how you can extend it:

  • Test across multiple AI models — OpenAI, Claude (Anthropic API), Gemini — since each has different training data.
  • Add a sentiment column — not just whether your brand is mentioned, but how positively.
  • Schedule it with cron on Mac/Linux to run weekly automatically.
  • Feed results into Google Sheets for a live dashboard.
About the Author: I’m Ram Shukla, an SEO strategist focused on helping brands grow their digital presence — now including AI-driven search. This script came out of my own need to track a client’s visibility across AI platforms, and I’ve been refining it since September 2025. Have questions or want a custom version built for your brand? Get in touch.

How SEO Helped a Fashion E-Commerce Brand Grow from 0 to 120,000 Monthly Organic Visitors in 14 Months (A Practical Shopify Case Study)

Shopify SEO · Case Study

120K
Monthly Organic Visitors
9%
Brand Conversion Rate
14 mo
Time to Results

A practical Shopify SEO case study on the architecture decisions, content fixes, and structural work that made sustainable organic growth possible — without shortcuts or tricks.


Fashion e-commerce SEO growth — 0 to 120,000 monthly organic visitors in 14 months on Shopify

Organic traffic growth across the 14-month engagement

Scaling organic traffic for a fashion brand is rarely clean or linear. The industry moves fast, competition is unforgiving, and the way customers actually search looks nothing like what store owners expect. Layer Shopify’s structural tendencies on top — URL bloat, variant duplication, app-generated pages — and most stores end up stuck before they’ve even started.

This project began in exactly that position. A leading fashion brand on Shopify. Over 200,000 URLs in the index. Zero meaningful organic traffic. Real inventory, real ambition, and no search visibility to show for any of it.

Fourteen months later, the same store was pulling 120,000 monthly organic visitors, converting at 9% on brand queries and 2.6% on non-brand, and competing with established category leaders in organic search. Here’s a clear-eyed account of how that happened.


01Shopify Was Working Against Them

Shopify is a genuinely good platform for running an online store. But it consistently generates far more URLs than any crawl budget can justify — and most merchants don’t realize this until the damage is already done.

By the time the first technical audit was complete, the store’s crawlable index looked like this:

Auto-generated tag URLs with no editorial value
Duplicated product paths created by Shopify’s default URL structure
Collection and product variant combinations multiplying the page count
Filter pages that served users but meant nothing to search engines
Orphaned product pages not connected to any collection
Thousands of product descriptions under 30 words
App-generated URLs from tools that had since been removed
The site wasn’t suffering from a lack of SEO effort. It was suffering from too many pages with no SEO value — and Google was treating the whole domain accordingly.

Before chasing rankings, the priority was controlling what Google was actually seeing. At that point, Google was seeing chaos — and indexing very little of it.

02Thin Content Was Diluting the Whole Site

Fashion brands almost universally underinvest in product copy. Descriptions tend to be a few words — sometimes just a color and material, often nothing more than a truncated line from the manufacturer. Google responds predictably: it allocates minimal crawl budget, indexes selectively, and rarely ranks pages that offer nothing beyond what competing stores already show.

When 70–80% of a site’s inventory pages are essentially duplicate shells, the whole domain suffers — not just the individual thin pages.

What changed with product content

120–180 word descriptions written with genuine shopping value — not keyword stuffing
Fabric details, fit notes, styling suggestions, and care guidance included naturally
Metafields used to keep the storefront clean while enriching indexed content
Content templates built so copywriters could produce consistently at scale
Metadata standardized to reinforce relevance signals across product types

The goal wasn’t to pad pages with words. It was to give both customers and search engines enough to make sense of each product. Once indexing stabilized, impressions in Google Search Console started climbing — slowly at first, then with real momentum.

03Collection Pages Became the Core of the Strategy

Fashion shoppers don’t search the way store owners expect. They rarely type in a product name or SKU. They search for categories, occasions, and contexts — “black maxi dress,” “summer tops for women,” “high-waist trousers,” “party wear gowns.” This traffic carries enormous commercial intent, and all of it lands on collection pages, not individual products.

If your collection pages are weak, no amount of product-level SEO will compensate. So collection pages became the primary focus of the entire strategy.

What went into each collection page

250–400 words of relevant, non-intrusive content placed naturally within the layout
Deliberate keyword mapping — primary term, secondary modifiers, and long-tail variants
Clean heading hierarchy with a single clear H1 and supporting H2s
Internal links to sub-collections and adjacent categories
Product schema and breadcrumb markup to support rich results
Metafields for custom SEO copy that didn’t interfere with the shopping experience
⭐ Key Result
Within a few months, category pages were pulling organic traffic that product pages never could on their own. Over time, collection pages became responsible for over 70% of all organic revenue from the site.

04Topic Clusters Helped Google Navigate a Massive Catalog

When a store carries thousands of products across dozens of categories, search engines need help understanding how everything relates. Without a clear structure, Google treats each page in isolation — and pages in isolation rarely rank for anything competitive.

Screaming Frog was used to map the entire internal linking structure, then rebuilt it with intent.

Clusters built for this brand

Dresses → Party dresses, Maxi dresses, Cotton dresses, Bodycon
Tops → Casual, Formal, Printed, Crop
Bottomwear → Skirts, Trousers, Shorts, Palazzos
Seasonal edits → Festive, Winter, Summer
Accessories and footwear sub-groups

Each cluster followed a clear hierarchy: main collection → sub-collection → individual product → supporting blog content. This structure signals depth and topical completeness — two things Google consistently rewards in competitive categories.

05Crawl Depth Was Silently Killing Rankings

One of the more surprising findings in the audit was how deep important pages were buried. Some of the brand’s best-selling collections sat five or six clicks away from the homepage. That depth sends Google a clear signal: these pages are not important. Crawl budget gets rationed accordingly, and rankings follow.

Structural fixes that moved the needle

Navigation restructured to surface priority categories at the first level
Internal linking rebuilt to pass equity toward high-value pages
Low-value pages pruned or consolidated to reduce crawl waste
Tag and filter URLs removed from crawl paths via robots.txt
Pagination cleaned up and standardized across collections
Thin sub-collections merged into stronger parent categories

Within a few months, priority collection pages sat comfortably at depth one or two. Google crawled faster, indexed more completely, and began ranking pages that had previously been invisible.

06A Content Calendar Built Around Intent, Not Just Seasons

Fashion content planning often stops at the editorial calendar — festive season, spring/summer, sale, repeat. That approach misses most of the organic opportunity. SEO growth requires evergreen, seasonal, and trend-driven content working together, with each piece reinforcing the site’s topical authority.

What the content calendar included

Seasonal stories: summer dresses, festive edits, winter layering guides
Styling guides with real shopping utility: “how to style a crop top for the office”
Educational content answering pre-purchase questions: “what is viscose fabric?”
Trend-adjacent posts tied to actual search behavior: “partywear colors trending this season”

Every piece of content was built to internally link back to relevant collection pages — reinforcing clusters, strengthening topical relevance, and giving Google additional signals about what this brand covers authoritatively.

07Technical SEO Work That Actually Moved Rankings

Fashion e-commerce is image-heavy, app-heavy, and often built on themes that weren’t designed with crawlability or page speed in mind. The technical debt compounds quietly until it becomes a ceiling on what content and structural work can achieve.

Technical fixes completed during the engagement

LCP improved by compressing product images and removing unused third-party scripts
Schema automated for products, collections, and breadcrumbs across the full catalog
Canonical issues resolved — particularly Shopify’s default duplicate URL patterns
Sitemap streamlined to include only indexable, high-value URLs
Robots.txt refined to guide crawlers away from app URLs and filter parameters
Legacy app junk removed from the crawlable index
Cumulative Layout Shift reduced across product and collection templates

None of this is glamorous. But technical stability is what allows content and structural improvements to actually perform.

08The Growth Curve: From 0 to 120K Monthly Visitors

Traffic didn’t spike. It built steadily, with each phase of work raising the ceiling for what came next.

Months1–3
Foundation: Cleanup & StabilityIndex cleanup, thin content fixes, canonical corrections. Crawl budget recovered. Technical baseline established.

Months4–6
Architecture: Collections & ClustersCollection pages rebuilt as landing pages. Topic clusters structured. Internal linking rebuilt. First ranking movements appear.

Months7–9
Depth: Blog Content & Link EquityContent calendar activated. Blog posts reinforce cluster authority. Internal link equity flowing toward priority pages.

Months10–14
Scale: Authority & Footprint ExpansionDomain authority grows. Category footprint expands. 120K monthly organic visitors confirmed. 9% brand / 2.6% non-brand conversion.

Monthly Organic Visitors
120K
From zero at project start
Brand Conversion Rate
9%
High-intent brand traffic
Non-Brand Conversion Rate
2.6%
Category-level traffic converting
Organic Revenue via Collections
70%+
Collection pages drove majority of revenue

09The Real Lesson: Shopify SEO Is Won in the Architecture

This project reinforced something most teams only discover after months of frustration: Shopify SEO is not won through clever tactics or tool hacks. It’s won through structure.

When categories are unclear, content is shallow, internal linking is weak, and crawl paths are messy — nothing else will compound. Fix the architecture first. Everything else follows.
— Ram Kr. Shukla, SEO & Growth Consultant

Once the architecture is clean, the compounding effect is real. Collection pages start ranking faster. Product pages get indexed more reliably. Blog content reinforces category authority. Internal links elevate entire clusters. Google extends trust across the domain rather than evaluating each page in isolation.

That’s the difference between organic growth that happens by accident — and organic growth that becomes predictable, scalable, and tied directly to revenue.

If your Shopify store is in a similar position — real products, real ambition, but search visibility that doesn’t reflect either — the answer is almost certainly structural before it’s anything else.

Ram Kr. Shukla — SEO & AI Growth Consultant
Ram Kr. Shukla
SEO & AI Growth Consultant
18+ years across SEO, programmatic media, and performance marketing. Partner to founders and CMOs scaling B2B, SaaS, and e-commerce brands through data-driven organic growth strategies.

Free Consultation
Is Your Shopify Store Sitting on Untapped Search Potential?
Let’s spend 30 minutes reviewing your SEO setup, identifying structural gaps, and outlining exactly where your growth is being held back.
Schedule a Free Growth Call

How Advanced SEO Turned an E-Commerce Store Into a ₹5Cr/Month Brand

How Advanced SEO Turned an E-Commerce Store Into a ₹5Cr/Month Brand

Is ranking on the first page of Google really worth it for e-commerce businesses? Wouldn’t it be faster and simpler to just run paid ads on Meta or Google Shopping? What’s the actual return — and will SEO ever generate enough revenue to justify the wait?

These are questions I hear from e-commerce founders, D2C brand owners, and digital marketing managers almost every week. The hesitation is understandable — SEO is slow, nuanced, and notoriously hard to attribute in the early months. But here’s the truth: when done with precision, SEO becomes the most scalable, cost-efficient revenue engine an e-commerce brand can build. I recently worked with — and studied in depth — an Indian D2C e-commerce brand (in the lifestyle and wellness space) that took this leap. The results they achieved in under two years make a compelling case that every e-commerce operator needs to see.

Here are the actual numbers that drove their transformation:

E-Commerce Brand: Revenue, Growth & SEO Numbers

Business Model D2C E-Commerce (Lifestyle & Wellness, India)
Annual Revenue Run Rate ₹48–55 Crore (high seven-figure INR ARR)
Markets Served India (Tier 1, 2 & 3 cities), UAE, UK
Monthly Organic Sessions 18,000+ qualified sessions/month from search
Organic Traffic Growth 312% in 22 months
Primary Acquisition Channel Organic Search (SEO + Content)
SEO + Content Investment ₹3.5–4 Lakh/month
Month-over-Month Revenue Growth 8–11% MoM (consistent)
SEO Timeline to Break-Even 6–9 months (established brand) / 18–24 months (new brand)

Where It All Started: The Problem With Paid-Only Growth

When this brand came to the SEO table, they were already doing decent numbers — roughly ₹8–10 Crore annually — entirely on the back of Meta ads and influencer campaigns. Their ROAS was around 2.8x, which looked fine on paper. But CPMs were climbing quarter on quarter, their customer acquisition cost had nearly doubled in 18 months, and one bad iOS privacy update had knocked their attribution into chaos. Sound familiar?

The core problem was dependency. Every rupee of revenue required a rupee (or more) of ad spend to sustain it. The moment the ad tap turned off, so did the orders. There was no compounding asset being built. SEO was the missing piece — not as a replacement for paid, but as a foundation that would make every other channel cheaper and more effective.

“Paid ads are a tap. SEO is a well. One you rent, one you own. The smartest e-commerce brands build both — but they never confuse one for the other.”

— Ram Kr. Shukla, SEO & Content Strategy

The Advanced SEO Tactics That Drove 312% Organic Growth

This wasn’t a “publish 3 blogs a week and wait” strategy. What moved the needle was a combination of technical precision, content architecture, and intent-mapping that most e-commerce brands simply don’t execute at this level. Here’s what was done:

1. Topical Authority Mapping (Not Just Keyword Research)

The first 60 days were spent building a full topical authority map — not just a keyword list. We identified 8 core content clusters around the brand’s product categories and buyer journey stages (awareness → consideration → decision). Each cluster had a pillar page, 6–10 supporting articles, and a clear internal linking strategy. Google rewards topical depth, not volume. Before writing a single word, the architecture was defined.

2. Category & Collection Page SEO (The Revenue Pages)

Most e-commerce SEO efforts focus entirely on blog content and completely neglect the pages that actually convert — category and collection pages. We rewrote every major category page with: keyword-rich, unique H1s and meta descriptions; 150–200 word SEO-optimised introductory copy above the fold; structured FAQ sections using Schema markup; and canonical tag hygiene across filtered URLs. These pages became the highest-converting organic landing pages within 6 months.

3. Core Web Vitals & Technical SEO Overhaul

A full technical audit revealed 340+ crawl errors, duplicate content from faceted navigation, missing Schema on product pages, and an LCP (Largest Contentful Paint) score above 4.8 seconds on mobile. Fixing these alone — before a single new content piece — produced a 27% lift in organic impressions within 10 weeks. Technical SEO isn’t glamorous, but it’s the bedrock everything else rests on.

4. Product-Led Content (Buying Guides That Actually Convert)

Rather than generic “top 10 tips” blog posts, we built deep buying guides targeting high-intent comparison and “best [product type] in India” keywords. Each guide was 2,000–3,500 words, included original data, internal links to product pages, and a recommendation matrix. These single pages now collectively drive over 4,200 organic sessions per month and contribute to a 3.1% organic conversion rate — more than double the site average.

5. Digital PR & Programmatic Link Building

Link building for e-commerce is different from SaaS. We deployed two parallel strategies: (a) Digital PR — creating data-driven studies around wellness/lifestyle trends in India that earned natural coverage on YourStory, Inc42, and Healthshots; and (b) Programmatic outreach targeting relevant niche bloggers and review platforms with a structured content partnership framework. Over 22 months, this built 280+ high-quality referring domains — up from just 34 at the start.