Web Analytics with Google Analytics 4BigQuery export and AI-assisted analysis · Lesson 20 of 20

AI-assisted GA4 analysis: Ask Advisor, Gemini, MCP and a verification ladder

Article · 8 min · 9 min lecture

Video lecture

AI-assisted GA4 analysis: Ask Advisor, Gemini, MCP and a verification ladder

15 chapters · about 9 min · full transcript

Coming soon

Chapter 1 of 15

AI-assisted GA4 analysis

  • Where AI sits now
  • A verification ladder
  • Prompt templates
  • Connecting via MCP, read-only
  • Privacy and governance

The narrated lecture is in production

Every chapter is scripted and ready. Browse the chapters and read the full transcript now — the video will appear here when it’s published.

Chapters

What AI can and cannot do with your GA4 data (2026)

AI now sits in several places in an analytics workflow:

WhereExamples (verify current availability)Best for
Inside GA4Analytics Advisor / Ask Advisor (Gemini-powered, beta in 2026)Quick orientation: "why did revenue drop last week?"
Inside Google CloudGemini assistance in BigQuery, conversational/data agents surfaced in Data StudioDrafting SQL, exploring tables, natural-language questions over curated data
General assistantsClaude, ChatGPT, Gemini with file upload and code executionAnalysis of exported, aggregated tables; writing Python/SQL; drafting narratives
Connected via MCPGoogle's experimental Google Analytics MCP server (read-only tools such as run_report, run_funnel_report, get_property_details)Letting an AI assistant query GA4 through the Admin and Data APIs with your credentials

AI is excellent at drafting queries, suggesting hypotheses, summarizing tables and writing first drafts of commentary. It is unreliable at knowing your tracking history, your definitions and your business context unless you give them, and it will produce confident answers from partial data. The rule from the rest of this course applies: AI proposes, you verify.

A verification ladder for AI answers

  1. Source check: which report, query or table did the number come from? If you cannot tell, it is not a finding.
  2. Recompute: rerun the key number yourself (report, Data API or SQL).
  3. Definition check: does "users" mean active users? Is revenue net of refunds? Is the attribution model stated?
  4. Context check: tracking changes, consent changes, releases, holidays (check the change log).
  5. Plausibility: does the size of the effect make business sense? Would you bet on it?

Hands-on: prompt templates that produce checkable work

Draft SQL from a question

You write BigQuery SQL for the GA4 export (dataset my-project.analytics_123456789, tables events_*).
Schema notes: parameters are in event_params (UNNEST); sessions = user_pseudo_id + ga_session_id;
session channel = session_traffic_source_last_click.cross_channel_campaign.default_channel_group;
revenue = ecommerce.purchase_revenue; always filter _TABLE_SUFFIX; exclude null user_pseudo_id for user counts.
Question: key-event rate by landing page for mobile users in September 2026, pages with >= 100 sessions.
Return: the SQL, then a line-by-line explanation, then two ways the result could be misleading.

Explain a change, from aggregated data only

Here is an aggregated table (no personal data): week, channel, device, sessions, key_events, revenue.
Known context: consent banner changed on 2 Sept for UK; new checkout released 14 Sept.
1) Decompose the revenue change into sessions, conversion rate and order value.
2) Name the segment that explains most of the change.
3) List 3 hypotheses with the GA4 report/exploration or SQL that would test each.
Use only numbers from the table; label any estimate as illustrative.

Draft weekly commentary

Write a what / so what / now what summary (max 120 words) for the leadership dashboard from this table.
Name the source (GA4 interface or BigQuery export) and the attribution model. No causal claims without a test.

Hands-on: connect an assistant through MCP (read-only)

Google's experimental Analytics MCP server runs locally and uses your Application Default Credentials. After enabling the Analytics Admin and Data APIs in a Google Cloud project and installing it (see the project's README for the current command), an MCP-capable assistant can call tools like run_report for your properties. Good practice: use an account with read-only (Viewer or Analyst) access, restrict it to the properties needed, and log what the assistant ran. Treat every answer as a draft to verify, exactly like Ask Advisor.

Privacy and governance

  • Send AI tools aggregated data wherever possible; never paste user-level exports with identifiers into unapproved tools.
  • Check your organization's approved tools, data-retention and training settings, and client contracts.
  • Keep a prompt library with the schema notes above so every analyst gets consistent SQL.
  • Record in the change log when AI-generated queries become scheduled production queries, and have a human review them first.

Worked example: a Dubai marketplace's Monday question

The CMO asks Ask Advisor why orders fell. It points to lower paid-social sessions. The analyst follows the verification ladder: the report confirms the session drop, but the change log shows the UK consent banner changed that week, and BigQuery shows the drop is concentrated in consent-denied traffic with no change in consented purchase rates. The commentary says: observed paid-social sessions fell mainly because of the new consent defaults; purchases from consented users are stable; no budget change recommended.

Second worked example: a Karachi agency's SQL copilot

An agency builds a shared prompt with its schema notes and asks Claude or ChatGPT to draft SQL for client questions. Every query is reviewed by a senior analyst against a checklist (suffix filter, session definition, null ids, revenue field, attribution field) before it touches a dashboard. Drafting time drops sharply; review catches the typical AI mistakes, such as counting sessions from session_start events inconsistently or forgetting the date filter.

Next steps

For statistics, forecasting and decision frameworks with AI, take AI for Data Analysis and Decision Making. For consent-aware collection and server-side tagging, take Privacy-First Measurement.

Pitfalls

  • Presenting an AI answer without a source you can open.
  • Pasting user-level data into unapproved tools.
  • Letting AI-generated SQL run in production without review.
  • Ignoring consent and tracking changes that explain "surprising" AI findings.

Key takeaways

  • AI now sits inside GA4 (Ask Advisor), Google Cloud (Gemini, Data Studio agents), general assistants and MCP connections.
  • AI proposes, you verify: source, recompute, definitions, context, plausibility.
  • Prompts with schema notes and rules produce checkable SQL and summaries.
  • Use read-only access, aggregated data and human review before anything reaches production.

Check your understanding

Quick questions to lock in the lesson. They don’t count towards your certificate.

  1. Ask Advisor says orders fell because paid-social sessions dropped. What should you do before presenting this?
  2. Which setup is most appropriate for connecting an AI assistant to GA4 through the Analytics MCP server?

Put it into practice

Ask Ask Advisor or an MCP-connected assistant one real question, climb the five-rung verification ladder, and note which rung changed the answer.

Enrol for free to save your progress

Reading is always free. Enrol to keep your place, take the final assessment and earn a verifiable certificate.