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
Video lecture
AI-assisted GA4 analysis: Ask Advisor, Gemini, MCP and a verification ladder
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
Transcript of the narration, chapter by chapter.
0:00 AI-assisted GA4 analysis
In twenty twenty-six, you can type a question like why did revenue drop last week directly into G A four, and an AI assistant will answer in seconds. That's genuinely useful. It's also a trap, because a confident answer isn't the same as a correct one. In this lecture you'll learn where AI now sits in the analytics workflow, a five-step verification ladder for AI answers, prompt templates that produce checkable work, how to connect an assistant to G A four safely through M C P, and the privacy rules that keep you out of trouble.
0:42 Why it matters
Why does this matter? Because AI shifts where analysts spend time. Drafting queries, summarizing tables and writing first-draft commentary now take minutes. That frees you for the parts AI is bad at: knowing your tracking history, your definitions, your consent changes and your business context. If you use AI well, you'll answer more questions, faster, with the same rigor. If you use it carelessly, you'll spread confident mistakes at scale.
1:12 Where AI sits
Here's where AI sits. Inside G A four, Analytics Advisor, with Ask Advisor in beta, answers plain-language questions about your property. Inside Google Cloud, Gemini helps draft SQL in BigQuery, and conversational data agents surface in Data Studio. General assistants like Claude, ChatGPT and Gemini can analyze exported, aggregated tables, write Python and SQL, and draft narratives. And through M C P, Google's experimental Analytics M C P server lets an assistant call read-only tools like run report, using your credentials.
1:47 AI proposes, you verify
The core principle: AI proposes, you verify. Think of AI like a brilliant new intern who has never seen your company before. They're fast, articulate and tireless. But they don't know that the consent banner changed last Tuesday, that revenue here means net of refunds, or that the thank-you page used to double count. You'd never forward an intern's first draft to the CEO without checking it. Treat AI output exactly the same way.
2:19 The verification ladder
Here's the verification ladder. Step one, source check: which report, query or table did the number come from? If you can't tell, it isn't a finding. Step two, recompute: rerun the key number yourself in a report, the Data A P I or SQL. Step three, definition check: does users mean active users, is revenue net of refunds, which attribution model? Step four, context check: tracking changes, consent changes, releases, holidays, straight from the change log. And step five, plausibility: does the size of the effect make business sense? Would you bet on it?
3:00 SQL prompts that work
Now prompts that produce checkable work. The secret is giving the model your schema notes and rules. For SQL, tell it the dataset, that parameters live in event params and need UNNEST, that sessions are user pseudo id plus ga session id, which field holds the session channel and revenue, and that it must always filter the table suffix. Then ask for the SQL, a line-by-line explanation, and two ways the result could mislead. That last request turns the model into its own first reviewer.
3:37 Explain and summarize prompts
For explaining a change, give aggregated data only, with no personal data: week, channel, device, sessions, key events, revenue. Add known context, like a consent banner change on the second of September and a new checkout on the fourteenth. Ask it to decompose the change, name the segment that explains most of it, list three hypotheses with the report or query that would test each, and use only numbers from the table, labeling estimates. And for weekly commentary, ask for what, so what, now what, naming the source and attribution model, with no causal claims without a test.
4:20 Example 1: Dubai marketplace
First example, a simple one. A Dubai marketplace's CMO asks Ask Advisor why orders fell. It points to lower paid social sessions. The analyst climbs the 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 purchase rates among consented users. The commentary says observed sessions fell mainly because of new consent defaults, purchases from consented users are stable, and no budget change is recommended. The AI found the what. The analyst found the why.
5:03 Example 2: Karachi agency SQL copilot
Second example, a business case. A Karachi 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 and attribution field, before it touches a dashboard. Drafting time drops sharply. And review keeps catching the typical AI mistakes, like forgetting the date filter or counting sessions inconsistently. AI speed plus human review beats either alone.
5:39 Watch me do it, part 1
Watch me use the SQL template. I paste the schema notes, then the question: key event rate by landing page for mobile users in September twenty twenty-six, pages with at least a hundred sessions. The assistant returns a query, an explanation and two risks: that landing pages with query strings may split, and that consent-denied sessions are excluded. I check it against my review list. The suffix filter is there. Sessions use ga session id. But it filtered mobile using the wrong field, so I fix that, run it, and compare the top rows with the interface.
6:21 Watch me do it, part 2
Next, I connect an assistant to G A four through M C P. Google's experimental Analytics M C P server runs locally and uses application default credentials, after I enable the Admin and Data A P Is in a cloud project and install it following the README. I use an account with read-only access, Viewer or Analyst, limited to the properties I need. Now I can ask my assistant to run a report on key events by channel for last week, and it calls run report. I still check the number against the interface before I use it.
7:04 Privacy and governance
Privacy and governance, briefly. Send AI tools aggregated data wherever possible, and never paste user-level exports with identifiers into unapproved tools. Check your organization's approved tools, retention and training settings, and client contracts. Keep a shared prompt library with schema notes, so every analyst gets consistent SQL. And when an AI-drafted query becomes a scheduled production query, have a human review it and record it in the change log.
7:34 Common mistakes
Common mistakes. 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 a surprising finding. And asking vague questions, which get vague, confident answers.
7:54 Recap
Recap. AI now lives inside G A four, inside Google Cloud, in general assistants, and behind M C P connections. AI proposes, you verify, using the ladder: source, recompute, definitions, context, plausibility. Give models schema notes and rules so their work is checkable. Connect with read-only access. And keep data aggregated and governed. If you want to go deeper on statistics and decisions, AI for Data Analysis and Decision Making is your next course. For consent-aware collection, take Privacy-First Measurement.
8:29 Try this now
Try this now. Ask Ask Advisor, or an assistant connected to your data, one real question about last week. Then climb the verification ladder: find the source, recompute the number, check definitions, check the change log, and judge plausibility. Write down which rung, if any, changed the answer. That note is the best argument for keeping humans in the loop.
What AI can and cannot do with your GA4 data (2026)
AI now sits in several places in an analytics workflow:
| Where | Examples (verify current availability) | Best for |
|---|---|---|
| Inside GA4 | Analytics Advisor / Ask Advisor (Gemini-powered, beta in 2026) | Quick orientation: "why did revenue drop last week?" |
| Inside Google Cloud | Gemini assistance in BigQuery, conversational/data agents surfaced in Data Studio | Drafting SQL, exploring tables, natural-language questions over curated data |
| General assistants | Claude, ChatGPT, Gemini with file upload and code execution | Analysis of exported, aggregated tables; writing Python/SQL; drafting narratives |
| Connected via MCP | Google'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
- Source check: which report, query or table did the number come from? If you cannot tell, it is not a finding.
- Recompute: rerun the key number yourself (report, Data API or SQL).
- Definition check: does "users" mean active users? Is revenue net of refunds? Is the attribution model stated?
- Context check: tracking changes, consent changes, releases, holidays (check the change log).
- 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.
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.