Trace ChatGPT Web Queries: Step-by-Step Guide

    A step-by-step tutorial on how to trace, log, and analyse the web queries ChatGPT runs when browsing the internet to find information.

    Alex Rapier

    AI Visibility Consultant · 10+ years in tech

    December 20248 min read

    When ChatGPT uses web browsing to answer questions, it runs real search queries behind the scenes. Tracing these queries reveals exactly what it's looking for—and why certain businesses get recommended while others don't.

    This step-by-step guide shows you how to capture and analyse ChatGPT's search behaviour, from simple methods anyone can use to advanced techniques for developers.

    Easiest Method: Use QueryTrace

    Our free Chrome extension captures every search query ChatGPT runs — automatically. No configuration, no coding required.

    Get QueryTrace Free

    Quick Method: Ask ChatGPT (2 minutes)

    The fastest way to see ChatGPT's queries is simply to ask.

    Step 1: Ask a question that requires web browsing

    "Who are the best accountants in Bristol for small businesses?"

    Step 2: After it responds, ask for the queries

    "What exact search queries did you run to answer that? List them all."

    Step 3: Ask which sites it read

    "Which websites did you visit? What information did you find most useful from each?"

    ChatGPT will typically provide a clear breakdown of its search process.

    Intermediate Method: Browser Network Tab (10 minutes)

    For more detailed insight, you can watch the actual network requests.

    Step 1: Open Developer Tools

    • Chrome/Edge: Press F12 or right-click → "Inspect"
    • Firefox: Press F12 or right-click → "Inspect Element"
    • Safari: Enable Developer menu in preferences, then Cmd+Option+I

    Step 2: Go to the Network tab

    Click "Network" at the top of the Developer Tools panel. This shows all HTTP requests the page makes.

    Step 3: Filter for relevant requests

    • Click "Fetch/XHR" to filter for API calls
    • Type "search" or "browse" in the filter box
    • Watch for requests as ChatGPT processes your question

    Step 4: Inspect the request details

    Click on any request to see:

    • Headers: What was sent
    • Payload: The query parameters (including search terms)
    • Response: What came back

    Advanced Method: API with Tool Call Logging

    If you're a developer, the OpenAI API gives you complete visibility into ChatGPT's browsing behaviour.

    Step 1: Set up an API call with browsing enabled

    import openai
    
    client = openai.OpenAI()
    
    response = client.chat.completions.create(
        model="gpt-4-turbo",
        messages=[
            {"role": "user", "content": "Who are the best plumbers in Manchester?"}
        ],
        tools=[{"type": "web_search"}],  # Enable browsing
    )

    Step 2: Extract the tool calls

    # The response includes tool_calls array
    for tool_call in response.choices[0].message.tool_calls:
        print(f"Tool: {tool_call.function.name}")
        print(f"Arguments: {tool_call.function.arguments}")
        # This shows the exact search queries run

    Step 3: Log and analyse patterns

    Build up a database of queries for your industry:

    # Example: Track queries over multiple tests
    queries_log = []
    for question in customer_questions:
        response = run_chatgpt_with_browsing(question)
        queries_log.append({
            "question": question,
            "searches": extract_search_queries(response),
            "sources_cited": extract_sources(response)
        })
    
    # Analyse: What queries surface your competitors but not you?

    What to Look For in the Queries

    Once you're tracing queries, here's what to analyse:

    1. Query reformulation

    ChatGPT often rephrases user questions. A user asking "good plumber near me" might trigger searches like:

    • "best rated plumbers [city]"
    • "emergency plumbing services [area]"
    • "plumber reviews [location]"

    2. Multi-step searches

    ChatGPT often runs multiple queries to build context:

    • First: Find options ("plumbers in Manchester")
    • Then: Verify quality ("[company name] reviews")
    • Finally: Check specifics ("[company] emergency callout")

    3. Trust-verification queries

    Before recommending a business, ChatGPT often searches for:

    • Reviews and ratings
    • Company credentials or certifications
    • Comparison articles mentioning the business

    Practical Example: Tracing a Local Business Query

    Let's trace a real example. User asks ChatGPT:

    "Can you recommend a good travel agent in Plymouth for a family holiday?"

    Using the methods above, we might see ChatGPT run:

    1. Query 1: "best travel agents Plymouth UK"
    2. Query 2: "Plymouth travel agency family holidays reviews"
    3. Query 3: "[top result company name] reviews trustpilot"

    If your travel agency doesn't appear in any of these searches, ChatGPT can't recommend you—no matter how good you are.

    Using Query Traces to Improve Visibility

    Once you've traced the queries, here's how to act on them:

    Action checklist:

    • Run each query on Bing—does your site appear?
    • Check if your site has content matching those exact phrases
    • Look at which competitors DO appear—what do they have?
    • Verify your business appears in review/comparison searches
    • Ensure your location and specialities are explicitly stated

    Common Gaps We Find

    From tracing hundreds of queries, here are the most common reasons businesses are invisible:

    • Location not explicit: Your site says "we serve the local area" instead of "we serve Plymouth, Saltash, and South Devon"
    • No review presence: ChatGPT can't find reviews to verify you're trustworthy
    • Generic descriptions: "Quality service" doesn't match "24/7 emergency callout" queries
    • Missing from directories: If you're not on industry directories, you're not in the search results ChatGPT reads

    Want us to trace the queries for your business?

    Our AI Visibility Audit systematically tests how ChatGPT, Claude, Gemini, and Perplexity respond to queries your customers ask. We show you exactly what's being searched and where you're missing.

    Get your AI visibility audit →

    Next Steps

    Start with the quick method—ask ChatGPT a question about your industry and then ask what it searched. You'll immediately see whether your business is even in the running.

    For ongoing monitoring, set up a simple process: once a week, test 5-10 questions your customers might ask. Trace the queries, note which competitors appear, and track your progress as you make improvements.

    The businesses that understand ChatGPT's search behaviour—and optimise for it—are the ones that get recommended.

    Ready to improve your AI visibility?

    Book a free discovery call to learn how AI assistants see your business and what you can do to get found.

    Book a Discovery Call