Back to Blog
Google Analytics MCP

Google Analytics MCP: 20 Natural Language Queries That Replace Hours of GA4 Work

Asva AI Team
Published: April 10, 2026
Updated: April 9, 2026
18 min read
Share this insight

Building a GA4 report used to mean opening Explore, dragging dimensions, applying filters, adjusting date ranges, exporting to a spreadsheet — and then repeating everything when someone asked a slightly different question.

The Google Analytics MCP changes that. It connects Claude directly to your GA4 property through the Google Analytics Data API. You type a question in plain English. Claude calls the right API endpoints, parses the response, and gives you an answer — often with interpretation, comparisons, and recommendations attached.

This guide covers the 20 most valuable natural language queries you can run right now, organized by use case. It also covers what the MCP can and can't do, the API compatibility gotchas that will trip you up, and how to chain queries into scheduled weekly reports.

https://cdn.sanity.io/images/en9d2pb2/production/de333cabeb9c6e85dc37a7eb7723849d4b5c7748-1200x630.png


What the Google Analytics MCP Actually Is

MCP stands for Model Context Protocol — a standard that lets AI models like Claude connect to external tools and data sources in a structured way. The Google Analytics MCP server is an open-source implementation that wraps the GA4 Data API in an MCP-compatible interface.

When you install it and point it at your GA4 property, Claude gains access to a set of tools it can call automatically based on your natural language request:

MCP ToolWhat It DoesWhen Claude Uses It
run_reportRuns a standard GA4 report (dimensions + metrics + date range + filters)Most queries — traffic, revenue, funnels, audiences
run_realtime_reportReturns live data for the last 30 minutesWhen you ask about "right now" or "active users"
get_property_detailsReturns property metadata — timezone, currency, data retention settingsWhen you ask about your GA4 property configuration
get_custom_dimensions_and_metricsLists all custom event parameters registered in GA4When you ask about custom events or parameters
list_google_ads_linksReturns linked Google Ads accountsWhen you ask about paid campaign linkage
list_property_annotationsReturns annotations on the GA4 timelineWhen you ask about events or changes flagged on specific dates
get_account_summariesLists all GA4 properties you have access toWhen you need to switch between properties

Claude decides which tool to call. You never interact with the tool layer directly. This is what makes the MCP genuinely different from copying API docs into a prompt — it's a live, authenticated connection to your data.


Quick Setup Reminder

If you haven't connected GA MCP yet, the full walkthrough is in the guide on how to connect Google Analytics MCP to Claude Code. The two things most people get wrong:

1. Use pipx install, not pipx run. Claude Code doesn't inherit your shell PATH, so pipx run analytics-mcp silently fails. Install it permanently:
pipx install analytics-mcp

2. Use your own OAuth client for authentication. The default Google OAuth client is blocked for Analytics API scopes. You need to create an OAuth 2.0 Desktop App client in Google Cloud Console and pass it explicitly:

gcloud auth application-default login \
  --client-id-file='path/to/your_oauth_desktop_client.json' \
  --scopes=https://www.googleapis.com/auth/analytics.readonly

Once configured, restart Claude Code. The GA4 tools load automatically and every query below works immediately.


The 20 Queries: Full Reference Table

Before diving into each category, here's the complete reference:

#CategoryQueryPrimary Metrics
1AI TrafficShow me all AI platform traffic last 90 days by source, sessions, revenue, CVRsessions, revenue, conversionRate
2AI TrafficCompare ChatGPT vs Perplexity vs Gemini this month — which converts best?sessions, conversionRate, revenue
3AI TrafficTop 10 landing pages for AI-referred traffic with sessions and AOVsessions, averagePurchaseRevenue
4AI TrafficAI referral traffic week by week over the last 6 monthssessions (weekly trend)
5AI TrafficAI traffic by device type — mobile vs desktop sessions and bounce ratesessions, bounceRate by deviceCategory
6RevenueTotal revenue from AI sources last 90 days vs paid search vs organicpurchaseRevenue by sessionSource
7RevenueTop 5 products purchased by chatgpt.com visitorsitemName, itemRevenue
8RevenueAOV from AI-referred sessions vs site averageaveragePurchaseRevenue
9RevenueMulti-session journeys starting with AI referral, converting via another channelsessions, conversions (cross-channel)
10FunnelSessions on /book-demo, avg duration, form_start events last 30 dayssessions, avgSessionDuration, eventCount
11FunnelConversion funnel: landing page to purchase for AI vs organic visitorsconversionRate by segment
12FunnelPages with highest exit rate for AI-referred visitorsexitRate, sessions
13FunnelScroll depth on /pricing — % of AI visitors scrolling past the foldscroll event, percentScrolled
14AudienceUsers from chatgpt.com last 30 days who did not purchaseusers, minus purchasers
15AudienceUsers who viewed a product page from AI source but didn't add to cartusers, pageView, minus add_to_cart
16AudienceNew vs returning user split for AI-referred trafficnewUsers, returningUsers
17Competitor Context% of total traffic from AI platforms vs 6 months agosessions share, trend
18Competitor ContextTraffic source trends — is AI share growing week over week?sessions by source, weekly
19Technical AuditPages with 500+ sessions but fewer than 5 form_start eventssessions, eventCount
20Technical AuditTraffic sources sending 50+ sessions/month with CVR below 0.5%sessions, conversionRate

Category 1: AI Traffic Analysis

These five queries form the foundation of any AI traffic audit. Start here every time you sit down to review AI channel performance.

Query 1: Full AI Platform Overview

"Show me all traffic from AI platforms in the last 90 days, broken down by source, sessions, revenue, and conversion rate"

This is the single most useful query in the list. It gives you the complete cross-platform picture — ChatGPT, Perplexity, Gemini, Claude, Copilot — ranked by sessions with revenue and CVR alongside. Run it first to understand relative platform contribution before you go deeper.

Claude will call run_report with sessionSource as the dimension, filter for known AI referral domains, and return a sorted table. Ask it to add a column for % of total sessions to contextualize each platform's share.

Query 2: Platform Conversion Comparison

"Compare ChatGPT vs Perplexity vs Gemini traffic this month — which converts best?"

Session volume alone is a vanity metric for AI traffic. Conversion rate is what matters — and the answer is often counterintuitive. Perplexity traffic frequently converts at 2–3× the rate of ChatGPT traffic because Perplexity users are in active research mode and click links with high intent.

This query surfaces that gap immediately. If Perplexity converts significantly better but sends fewer sessions, that's an AEO investment signal: more citations on Perplexity = disproportionate revenue lift. For more on building that visibility, see our guide to how to track AI referral traffic in GA4.

Query 3: Top Landing Pages for AI Traffic

"Which landing pages get the most AI-referred traffic? Show top 10 with sessions and AOV"

This tells you which pages AI platforms are sending users to — and which of those pages actually monetize. A product collection page with high sessions and high AOV from AI visitors is a page worth optimizing aggressively for AI citation. A homepage with high sessions but low AOV suggests AI is sending top-of-funnel traffic that isn't reaching the right products.

Claude will run a report with landingPage and sessionSource dimensions filtered to AI sources, sorted by sessions.

Query 4: Weekly AI Traffic Trend

"How has AI referral traffic trended week by week over the last 6 months?"

Point-in-time numbers miss the trajectory. This query returns a week-by-week time series — essential for spotting inflection points. Did traffic spike when a specific AI platform updated its model? Did a content publication or PR mention drive a sustained lift? Did a competitor's displacement of your citations cause a drop?

Ask Claude to annotate the trend with any obvious breakpoints: "Mark the weeks where week-over-week change exceeded 20%."

Query 5: AI Traffic by Device Type

"Show me AI traffic by device type — mobile vs desktop sessions and bounce rate"

AI referral traffic skews heavily toward mobile, especially from ChatGPT's iOS app. Mobile AI visitors often arrive with stripped referrer headers — meaning GA4 records them as direct traffic. The sessions you can see from AI sources on mobile represent only a fraction of the true mobile AI referral volume.

Beyond attribution, this query diagnoses mobile UX issues. If mobile AI-referred sessions have a bounce rate 30%+ higher than desktop, your landing pages aren't converting mobile intent into engagement — a fixable landing page problem, not a traffic quality problem.


Category 2: Revenue Attribution

These four queries move beyond traffic volume into the revenue layer. They require ecommerce tracking to be correctly implemented in GA4.

Query 6: AI Revenue vs Other Channels

"What is the total revenue from AI referral sources in the last 90 days? Compare to paid search and organic"

This is the query that makes AI traffic a boardroom conversation. Run it, look at the AI revenue number, and then apply the 5-layer attribution model from the how to track AI referral traffic in GA4 guide to estimate true revenue contribution. GA4's number is always an undercount — but it's the starting point.

When asking Claude to compare channels, include the instruction: "Also show revenue per session for each channel, not just total revenue." This normalizes for the fact that AI sends lower absolute volume than organic — but often delivers higher value per visit.

Query 7: Top Products from ChatGPT Visitors

"Show me the top 5 products purchased by visitors who arrived from chatgpt.com"
Important API gotcha: You cannot run this as a single query. The GA4 API does not allow mixing ecommercePurchases with the itemName dimension in one report call. You need two separate queries:
  • "Show me total transactions and revenue for sessions originating from chatgpt.com"
  • "Show me the top 10 products by itemRevenue for sessions originating from chatgpt.com"
  • Then ask Claude: "Synthesize these two reports — which products drive the most ChatGPT-attributed revenue?"

    The output tells you exactly which products ChatGPT is driving discovery for. Cross-reference with your AEO content: is ChatGPT mentioning these products in relevant prompts? Use the brand visibility tracker to see which prompts are generating your AI citations.

    Query 8: AI vs Site-Average AOV

    "What's the average order value from AI-referred sessions vs the site average?"

    Typical result: AI-referred AOV runs 15–25% above site average. The mechanism is simple — AI platforms recommend specific products in response to high-intent queries ("best moisturizer for dry skin," "fastest noise-cancelling headphones under $200"). Users arrive already pre-sold on a category, often a premium one.

    If your AI AOV is at or below site average, it usually signals a landing page mismatch: AI is sending users to category pages or the homepage rather than the specific product they were recommended. Fix the destination.

    Query 9: Multi-Session AI-Influenced Journeys

    "How many multi-session journeys started with an AI referral before converting via another channel?"
    This is the hardest query in the revenue section because GA4's session-scoped attribution model doesn't natively track user-level journeys across sessions. The closest approximation: ask Claude to run a report segmented by users who had at least one session from an AI source in the lookback window, cross-referenced with users who converted. Claude can use the run_report tool with user-level metrics and then reason over the overlap.

    For true multi-touch attribution across sessions, you need either GA4's data-driven attribution model (available in the Attribution reports) or BigQuery export. But this query gives you a directional sense of how often AI is the first touch in a conversion path.


    Category 3: Funnel Diagnosis

    These queries turn the GA MCP into a funnel debugger. Instead of clicking through GA4's Funnel Exploration, you ask Claude directly.

    Query 10: Demo Page Funnel Health

    "How many sessions landed on /book-demo in the last 30 days? What's the average session duration and how many form_start events fired?"

    This single query answers three questions that would take three separate GA4 reports to build manually: traffic volume, engagement depth, and form interaction rate. If 2,000 sessions landed on /book-demo, average duration was 45 seconds, and only 80 form_start events fired, you have a serious above-the-fold problem — users are leaving before they even engage with the form.

    Follow up with: "What % of /book-demo sessions from AI sources fired the form_start event?" to determine whether AI-referred visitors engage more or less than average.

    Query 11: AI vs Organic Conversion Funnel

    "Show me the conversion funnel from landing page to purchase for AI-referred visitors vs organic"

    Ask Claude to run this as a step-by-step funnel: sessions → product page view → add_to_cart → begin_checkout → purchase. Request both AI-referred and organic segments side by side. The drop-off pattern tells you where AI-referred visitors specifically fall out of the funnel — often at add-to-cart if the landing page doesn't match the product context that generated the AI recommendation.

    Query 12: High Exit Pages for AI Visitors

    "Which pages have the highest exit rate for visitors who arrived from AI platforms?"

    Exit rate for AI-referred visitors is a trust signal. Pages where AI visitors leave at high rates are pages that fail the implicit promise of the AI recommendation — the user expected something specific based on what the AI said, and the page didn't deliver. This is fixable with better landing page copy that explicitly addresses the AI-driven query context.

    For deeper analysis of which AI platforms are driving traffic and which content generates citations, the GA4 custom reports for AI traffic guide has templates you can import directly.

    Query 13: Pricing Page Scroll Depth

    "Show me scroll depth events on /pricing — what % of AI visitors scroll past the fold?"
    This requires scroll tracking to be enabled in GA4 (it's on by default for Enhanced Measurement). Claude will filter scroll events for sessions originating from AI sources on the /pricing page and calculate what % reached the default 90% scroll threshold.

    If fewer than 30% of AI-referred visitors scroll past the fold on your pricing page, the above-fold content isn't compelling enough to justify continued reading. The recommendation is almost always: move the most compelling proof point (a specific product name, the price, or a key differentiator) above the fold.


    https://cdn.sanity.io/images/en9d2pb2/production/a4fdb43915514079a0b09009c803120c2a68b7bc-902x878.png

    Category 4: Audience Building

    These queries identify the specific user segments most valuable for remarketing, CRM enrichment, and personalization.

    Query 14: Non-Converting AI Visitors

    "List all users who visited from chatgpt.com in the last 30 days but did not complete a purchase"

    This is your highest-priority remarketing audience — users who received a ChatGPT recommendation, clicked through, but didn't convert. They have demonstrated intent twice: once by asking an AI, once by clicking the recommendation. Re-engagement rates for this audience typically run 3–5× above cold retargeting benchmarks.

    Claude will calculate this as: total users from chatgpt.com minus users from chatgpt.com who fired a purchase event. Export this user count for Google Ads audience building.

    Query 15: Product Viewers Without Cart

    "How many users viewed a product page after arriving from an AI source but didn't add to cart?"

    This funnel segment identifies the drop between product discovery and purchase intent. It's a larger audience than non-purchasers and more upstream in the funnel — ideal for upper-funnel retargeting with social proof, user reviews, or price reinforcement rather than a direct purchase CTA.

    Query 16: New vs Returning AI Visitors

    "Show me new vs returning user split for AI-referred traffic"

    This one simple split reveals a lot about your AI citation maturity. If 90%+ of AI-referred visitors are new users, your brand is in the discovery phase — AI platforms are introducing your brand to people who haven't heard of you. If 30–40% are returning users, AI is also functioning as a re-engagement channel, bringing back users who already know you but were prompted to return by a relevant AI recommendation.

    Each scenario calls for different landing page optimization: new users need brand credibility signals, returning users need product-specific context and offers.


    Category 5: Competitive Context

    These two queries frame your AI traffic performance in a competitive context — not against other brands, but against your own historical baseline.

    Query 17: AI Share of Total Traffic

    "What percentage of total traffic comes from AI platforms? How does that compare to 6 months ago?"

    Ask Claude to run two reports: last 30 days and the equivalent 30-day period 6 months ago. Calculate AI sessions as a percentage of total sessions for both periods. If AI share grew from 1.2% to 3.8% in six months, you're in a strong position. If it declined, you need to investigate whether a competitor displaced your citations or whether a platform algorithm change reduced recommendation frequency.

    Pair this with the brand visibility tracker to monitor citation share across AI platforms in real time — before the traffic data shows the impact.

    Query 18: Week-Over-Week AI Share Growth

    "Show me traffic source trends — is AI share growing week over week?"

    Request weekly granularity for the last 13 weeks (one quarter). Ask Claude to calculate AI sessions as % of total sessions for each week and identify the trend direction. A growing AI share — even from a low base — is one of the strongest leading indicators that your answer engine optimization investments are compounding.


    Category 6: Technical Audit

    These two queries use the GA MCP as a technical health check — identifying tracking gaps and underperforming traffic sources that waste budget.

    Query 19: Potential Tracking Gaps

    "Show me all pages with more than 500 sessions but less than 5 form_start events — potential tracking gaps"

    This query surfaces pages with high traffic volume but suspiciously low event counts. When a page with 800 sessions fires only 2 form_start events, there are three possibilities: the form rarely loads in the viewport, the form tracking is broken, or visitors genuinely don't interact with the form. The GA MCP surfaces the anomaly — you investigate the cause.

    Claude will run a report with pagePath as a dimension, filter for sessions > 500, and filter for form_start event count < 5. Expect the output to include 3–8 pages that warrant immediate investigation.

    Query 20: Low-Converting Traffic Sources

    "List all traffic sources sending more than 50 sessions/month that have a conversion rate below 0.5%"

    This is a budget efficiency audit. Every traffic source sending meaningful volume with near-zero conversion is either poorly targeted or landing users on the wrong page. If paid social campaigns show up here at high spend, you have a direct optimization opportunity. If organic sources appear, you have a landing page mismatch or intent alignment problem.

    Ask Claude to sort by sessions descending and flag any paid sources: "Which of these low-CVR sources are paid campaigns vs organic?"


    GA4 API Compatibility Gotchas

    The GA MCP exposes the GA4 Data API directly. That means it inherits all of the API's quirks. These are the ones that will cause errors or silent inaccuracies if you don't know about them.

    GotchaWhat HappensHow to Work Around It
    ecommercePurchases + itemName conflictAPI error: cannot combine these in one reportRun two separate reports — one for purchase totals by source, one for top products
    Date ranges over 12 monthsData is sampled — numbers will be approximateUse BigQuery export for unsampled historical data
    Real-time data limitationsrun_realtime_report only covers the last 30 minutesFor same-day data, use run_report with today's date
    More than 9 dimensions in one reportAPI errorSplit into multiple reports and ask Claude to join them
    Custom event parameters not in the APIParameter not found errorEnsure custom dimensions are registered in GA4 Admin before querying
    sessionConversionRate vs userConversionRateThese return different numbers — Claude may pick eitherExplicitly specify which conversion rate you want in your query
    Regex filter limitsGA4 API regex is more limited than standard regexUse simple contains/exact match filters where possible
    The most common error is the ecommercePurchases + itemName conflict. When it happens, Claude will return an API error message. The fix: break the query into two parts as described in Query 7 above.

    Chaining Queries: Ask Claude to Synthesize Multiple Reports

    The real power of the GA MCP isn't running one query at a time — it's asking Claude to run several reports and reason across all of them.

    Here's an example chain prompt that covers the full AI traffic picture in one conversation turn:

    "Run three GA4 reports for me: (1) AI referral traffic by source for the last 90 days with sessions, revenue, and conversion rate; (2) top 10 landing pages for AI-referred sessions with AOV; (3) AI traffic week-by-week trend for the last 26 weeks. Once you have all three, synthesize the findings: which AI platform should we prioritize for optimization, which landing pages need work, and is the trend positive or negative?"
    Claude will run all three run_report calls sequentially, then reason across the combined output to produce a strategic recommendation — something that would take a human analyst 45–90 minutes to do manually.

    You can extend this pattern with up to five or six chained reports before context window constraints become a factor. For very large datasets, ask Claude to summarize each report before pulling the next one.


    Scheduling Weekly AI Traffic Reports

    For teams that want automated weekly reporting without manual Claude sessions, you can combine the GA MCP with cron and Claude's CLI mode.

    The architecture:

  • A shell script that calls Claude non-interactively with a pre-written prompt
  • Claude uses the GA MCP to pull this week's AI traffic data
  • Output is written to a file or posted to a Slack webhook
  • Cron runs the script every Monday morning
  • Example shell script (weekly-ai-report.sh):
    #!/bin/bash
    DATE=$(date +%Y-%m-%d)
    OUTPUT_FILE="/reports/ai-traffic-$DATE.md"
    claude --no-interactive \
      --prompt "Run a GA4 report for the last 7 days. Show me: (1) total sessions from AI platforms (chatgpt.com, perplexity.ai, gemini.google.com, claude.ai) broken down by source; (2) total revenue attributed to AI sources; (3) week-over-week change vs the previous 7 days; (4) top 3 landing pages for AI-referred sessions. Format the output as a clean markdown summary with key takeaways." \
      > "$OUTPUT_FILE"
    # Optional: post to Slack
    curl -X POST -H 'Content-type: application/json' \
      --data "{\"text\": \"$(cat $OUTPUT_FILE | head -20)\"}" \
      $SLACK_WEBHOOK_URL
    

    Crontab entry (run every Monday at 8:00 AM):

    0 8 * * 1 /Users/yourname/scripts/weekly-ai-report.sh
    

    Prerequisites:

    • Claude Code installed and authenticated
    • GA MCP installed via pipx and configured in ~/.claude.json
    • GA4 property ID set as environment variable or hardcoded in the prompt
    • Slack webhook URL for delivery (optional)

    This setup takes about 30 minutes to configure. After that, your team gets a Monday morning AI traffic brief every week — automatically, without anyone opening GA4.

    For teams who want this without the setup overhead, the AI traffic decoder handles automated AI traffic monitoring, attribution, and weekly reporting with zero infrastructure to maintain.


    What to Do After Running These Queries

    The 20 queries above give you data. The value is in what you do with it.

    If AI CVR is below organic CVR: Audit landing pages for AI-referred visitors specifically. The AI recommendation created an expectation — your page needs to meet it. Add the product or category name that AI platforms are recommending you for above the fold.

    If AI AOV is at or below site average: AI is landing users on the wrong pages — likely category or homepage rather than specific product pages. Review Query 3 (top landing pages) and optimize the pages AI sends users to for conversion, not just discovery.

    If AI traffic share is declining: Check the brand visibility tracker to see if your citation share has dropped on specific platforms. A traffic decline often lags a citation share decline by 2–4 weeks.

    If Query 19 surfaces tracking gaps: Fix event tracking before drawing conclusions from any other query. Broken form tracking invalidates funnel analysis entirely.

    For a complete framework on turning AI traffic data into AEO strategy, the guide on answer engine optimization covers how to move from measurement to systematic citation growth.

    Book a demo to see how Asva AI automates AI traffic measurement, attribution, and optimization across ChatGPT, Perplexity, Gemini, and every emerging AI platform.

    See How Your Brand Shows Up in AI Search

    Get a free AI visibility audit — see where you rank in ChatGPT, Perplexity, Gemini, and more.

    Comments (0)

    Leave a Comment

    No comments yet. Be the first to comment!