949.822.9583
support@launchcodex.com
  • AI marketing & automation

Google Analytics MCP is live: How to connect GA4 to your AI assistant

Last Date Updated: November 8, 2026
  • 11 minute read
Google now offers two official ways to connect GA4 to AI assistants: the open source analytics-mcp server and a hosted Data API endpoint. Setup takes under an hour. Accurate answers take more. You need a short context file that defines key events, users, channels, and hostnames, plus a habit of checking numbers.
Google Analytics MCP is live_ How to connect GA4 to your AI assistant

Table Of Contents

Share This Article
Build-operate-transferCo-buildBuild-operate-transferVenture sprint
Ready for a free checkup?
Get a free business audit with actionable takeaways.
Key takeaways (TL;DR)
  • Google ships a local GA4 MCP server (version 0.8.0, nine tools) and a hosted endpoint for the Analytics Data API.
  • Both are read-only by default. A Viewer role and the analytics.readonly scope are all your assistant needs.
  • Access is the easy part. A one page context file is what makes answers match your GA4 reports.

You probably already have GA4. Google Analytics runs on 43.7 percent of all websites, according to W3Techs. Now you can ask that data questions from Claude, Gemini, Cursor, and other AI assistants through the Model Context Protocol (MCP). The setup guides online are scattered, and several already list the wrong tools or miss the hosted option.

Here is our view: connecting GA4 is now a sub one hour job, so access is no longer the hard part. The teams that get trustworthy answers write down their GA4 definitions before they connect. In a Launchcodex test of 20 recurring reporting questions across 12 client properties, 480 runs in total, assistant answers matched the GA4 interface 64 percent of the time with GA4 access alone and 87 percent of the time once the assistant also had a one page context file. This guide covers what is live, which route to pick, how to set it up, and how to make the numbers hold up in a client report.

What Google Analytics MCP options are live right now

As of November 2026, Google offers two official MCP routes for GA4. The open source analytics-mcp server runs on your computer and exposes nine tools in version 0.8.0. A hosted endpoint at analyticsdata.googleapis.com/mcp/v1 runs on Google’s side and covers reporting. Analytics Advisor, the Gemini assistant inside GA4, is a third option that needs no setup.

Ready to grow your organic traffic?

Get a free SEO audit from the Launchcodex team.

Book a Free Audit

Last verified: November 9, 2026. Tool counts and endpoint status change often, so check the links below before you commit to a route.

A context file lifts answer accuracy

The local analytics-mcp server

Google’s Analytics team created the google-analytics-mcp repository on GitHub in July 2025 and published version 0.1.0 on August 22, 2025. Version 0.8.0 shipped on October 22, 2026 with nine tools, including:

  • run_report for standard reports
  • run_funnel_report for funnels
  • run_realtime_report for live activity
  • run_conversions_report for conversions, ad cost, and attribution

Several popular guides still say the server has seven tools. That count is out of date.

Google’s official setup page says the server handles read requests only and cannot modify Analytics settings. The README lists one write tool, create_property_annotation. It only appears when you start the server with the –allow-write flag and credentials that carry the analytics.edit scope.

The hosted Data API endpoint

Google now documents a global, hosted MCP endpoint in its Data API MCP reference. When Windsor.ai tested it on September 30, 2026, it listed four tools: run_report, get_metadata, run_realtime_report, and check_compatibility. All four sit behind Google OAuth.

This matches where Google is heading. At Cloud Next ’26, Google said that more than 50 Google-managed MCP servers are generally available or in preview.

Analytics Advisor inside GA4

Google announced Analytics Advisor on November 12, 2025, with a rollout to English language accounts in early December 2025. It covers standard and 360 properties. It needs no setup, but it lives inside GA4 and cannot pull your other tools into the same chat.

Which GA4 connection route fits your team

Pick the route based on where your team works and what data the question needs. Use the local server for Claude Code, Claude Desktop, Gemini CLI, or Cursor. Test the hosted endpoint for remote-capable clients. Use Analytics Advisor for quick GA4-only questions. Use a third-party connector only when you need GA4 and other sources in one chat without managing Google Cloud.

MCP is now a vendor neutral standard. When Anthropic donated MCP to the Linux Foundation’s Agentic AI Foundation, it reported more than 10,000 active public MCP servers and adoption by ChatGPT, Cursor, Gemini, Microsoft Copilot, and Visual Studio Code. One GA4 setup can serve several assistants.

Route comparison

OptionWho it fitsKey strengthWatch out for
Local analytics-mcp serverTeams using Claude Code, Claude Desktop, Gemini CLI, or CursorGoogle’s own code, nine tools, account and property lookupNeeds a Cloud project, Python, and credentials on each machine
Hosted Data API endpointRemote-capable MCP clientsNo local install, Google OAuthFour tools only, so you need property IDs on hand
Self-hosted remote deploymentTeams that want one shared URL for many usersWorks with web based assistantsYou own hosting, auth, and updates
Analytics AdvisorQuick questions inside GA4Zero setupGA4 only, no cross-tool workflows
Third-party hosted connector (Stape, Windsor.ai, Manifold)Teams that want GA4 plus Search Console or ads data in one chatSign in with Google, no Cloud projectAnother vendor holds access to your data

Pitfalls when choosing a route

  • Assuming claude.ai or ChatGPT can launch the local server. Web based assistants accept only remote MCP connectors over HTTPS.
  • Paying for a third-party connector to answer GA4-only questions that Google’s own routes already cover.
  • Forgetting that the hosted endpoint has no account lookup tools. List every property ID in your context file.
  • Rolling a route out to your whole team before one person has tested it end to end.

How to connect GA4 to Claude, Gemini, or Cursor step by step

To connect the local server, enable two Google APIs, give an account Viewer access, create read-only credentials, and add one command to your assistant. Most failures come from a disabled API or a missing role, not from the assistant. Check those two items before you start and setup usually takes well under an hour.

Across 18 local server setups the Launchcodex team completed for client properties, the median time from a new Google Cloud project to the first correct report was 38 minutes. Eleven of the 18 first attempts failed on a disabled Admin API or a missing Viewer role.

“We now run a two minute pre-flight before anyone opens a terminal. Confirm both APIs are on in the exact project named in GOOGLE_CLOUD_PROJECT, then confirm the service account email shows up under Property access management. Skipping that check caused most of our failed first attempts.” Derick Do, Co-Founder and Chief Product Officer

The six setup steps

  1. Install Python 3.10 or higher, plus pipx or uv.
  2. In a Google Cloud project, enable both the Google Analytics Admin API and the Google Analytics Data API.
  3. In GA4, open Admin, then Property access management, and give the account the Viewer role. Nothing higher.
  4. Create Application Default Credentials with the analytics.readonly scope. Use service account impersonation if you can, rather than a downloaded key file.
  5. Add the server to your client. In Claude Code, run claude mcp add analytics-mcp –scope user with your GOOGLE_APPLICATION_CREDENTIALS path and GOOGLE_CLOUD_PROJECT ID, followed by — pipx run analytics-mcp. Claude Desktop, Gemini CLI, and Cursor take the same values in a JSON config file.
  6. Ask for one number you already know, such as last week’s sessions for one property, and compare it with the GA4 interface.

Fix the common first-run errors

  • A 403 that names the Admin API means the API is off in that Cloud project. Enable it and retry.
  • “Permission denied” on every report means the account has no access to the property. Add it as a Viewer.
  • An access-not-configured error with your own login means the credentials have no quota project. Set GOOGLE_CLOUD_PROJECT in the config.

What it costs in quota and context

The server is free. Reports draw on your property’s Data API quota. Standard properties get 200,000 Core tokens per day and 40,000 per hour. Analytics 360 properties get 2,000,000 per day and 400,000 per hour. Google says most requests charge 10 or fewer tokens.

Context is the cost you will notice first. In ContextBolt’s Claude Code test, the nine tool definitions added about 9,200 tokens to every request. Turn the server off in sessions that do not need GA4.

The GA4 assistant operating model

The GA4 assistant operating model

The GA4 assistant operating model has five parts: route, access, context file, question library, and tie-out. It exists because access alone produces confident numbers that do not match your reports. Written definitions and a checking habit fix that, and they keep working after your tracking changes.

The research supports this. Anthropic’s data science team reports that Claude answered no more than 21 percent of its internal analytics evaluations correctly without structured context files. With them, the team says “95% of business analytics queries are automated via Claude, with ~95% accuracy in aggregate,” as InfoQ reported. In a separate Cube benchmark of 100 questions across three frontier models, adding a semantic layer document raised first-shot accuracy by 17 to 23 percentage points. Model choice within the same tier did not explain the difference.

Most marketing teams are not there yet. In the Supermetrics 2026 Marketing Data Report, 80 percent of 435 marketers felt pressure to adopt AI, but only 6 percent had AI fully embedded in their workflow.

1. Route

Choose one route per use case and write it down. Your weekly reporting analyst might use the local server in Claude Code. A sales lead who needs a quick traffic check might use Analytics Advisor. Keep each recurring report on one route so the same context file and question library apply every time.

2. Access

Create one dedicated service account per organization. Give it the Viewer role on each property it needs and the analytics.readonly scope. Leave the write flag off. Prefer impersonation over JSON key files.

Credentials are the weak point across MCP. Astrix Security found that 88 percent of MCP servers require credentials and 53 percent rely on long-lived static secrets such as API keys or personal access tokens. A downloaded service account key is exactly that kind of secret.

3. Context file

The context file is a one page document your assistant reads before it queries GA4. It maps your business terms to exact GA4 fields.

Property configuration causes many wrong answers before the model ever runs. When Launchcodex audited 42 client GA4 properties before connecting them to an AI assistant, 30 of them, or 71 percent, had at least one issue that would skew the assistant’s answers. The issues included unfiltered internal traffic, more than 10 percent of sessions with a (not set) landing page, and two hostnames sharing one property.

Windsor.ai found the same kind of problem on its own property. In its GA4 MCP test, adding the event scoped hostname dimension raised Google organic sessions from 122,285 to about 163,000. About 19 percent of Google organic sessions had a (not set) landing page.

What to put in the file

  • Property map: property names, numeric property IDs, time zones, and currencies
  • Hostnames: which hosts belong in each report and which to exclude
  • Lead and sale definitions: the single key event that counts for each
  • User metric of record: activeUsers or totalUsers, and why
  • Channel rules: any custom channel group and how to treat (not set)
  • Exclusions: internal traffic filters, test events, staging hosts
  • Date rules: use complete weeks and leave out today

“Keep it short enough to read in two minutes. If your file runs past a page, the assistant starts treating every line as equally important. The two lines we write first are the lead key event and the hostname filter, because those are where we see assistants guess first.” Derick Do, Co-Founder and Chief Product Officer

Example: one key event fixed a lead count

For one multi-location home services client, the assistant’s first monthly lead count combined form starts with form submissions and overstated leads by 38 percent. Naming the single key event that counts as a lead in the context file fixed it on the next run.

4. Question library

Write 10 to 20 recurring questions with the exact fields, date ranges, and comparison periods written in. Matei Nicolae-Onea, Director of SEO at Windsor.ai, notes that when an assistant splits a question into several requests and joins the results, “that join is where most wrong answers come from.” Pinned questions leave the assistant less to guess.

Two examples:

  • “Report sessions and key events by sessionDefaultChannelGroup for the last 28 complete days versus the previous 28 days. Name every field you use.”
  • “List the top 20 organic landing pages by sessions for last month, filtered to the main hostname. Show the session count next to every rate.”

5. Tie-out

Check one number per answer against the GA4 interface. Ask the assistant whether the response flagged thresholding, sampling, or an (other) row. Ask which numbers came from a tool and which it calculated. Jesse Sibley, founder of Manifold, warns that “LLMs can make arithmetic mistakes on large numbers.”

“Our rule for client decks is one tied-out number per slide. If the assistant calculated a rate itself, we rebuild that rate from the two raw numbers before it goes in front of a client.” Tanner Medina, Co-Founder and Chief Growth Officer

Then keep the file current. Anthropic’s team watched offline accuracy fall from about 95 percent to about 65 percent within a month before it treated maintenance as an engineering task, according to Anthropic’s write-up. Update your context file every time you change tracking, add a key event, or launch a new hostname.

Most GA4 properties need fixes before AI

What GA4 still cannot tell your AI assistant

GA4 only knows about visits that reached your site. It cannot name the organic Google searches behind those visits, show impressions that never turned into clicks, or see revenue that lives in your CRM. For those questions, connect Search Console, the BigQuery export, or your CRM next to GA4.

Search queries live in Search Console

GA4’s Data API has no dimension for organic Google search queries. In ContextBolt’s test, the agent found the campaign term “(not provided)” on about 93 percent of organic sessions. Search Console metrics in the API were refused without an active Search Console link. ContextBolt founder David describes what GA4 alone can tell you about a winning page: “It can’t tell you why, or what to write next.”

“When a client asks why organic leads dropped, GA4 answers half the question. We pull Search Console queries for the same landing pages and the same date range in the same chat before we say anything about the cause.” Tanner Medina, Co-Founder and Chief Growth Officer

Know when to reach for other sources

QuestionBest source
Which channel drove sessions or key eventsGA4 through MCP
Which searches and positions drove clicksGoogle Search Console
Raw events, custom sessions, or joinsGA4 BigQuery export with the BigQuery MCP server
Closed revenue and pipelineYour CRM

If your question involves AI search, such as how often assistants cite your pages, GA4 is only one input. That work belongs in a broader AI search visibility program.

How to set up GA4 MCP across many properties

For franchises, multi-location brands, and agencies, use one service account with Viewer access on every property, one shared context file with a full property map, and one question library. This avoids dozens of credential files and keeps every location’s numbers defined the same way.

GA4 MCP setup by the numbers

Example: a 30 location franchise

Say a franchise runs 30 location properties. Instead of 30 logins, the team adds one service account as a Viewer on each property. The context file lists all 30 property IDs, the shared lead key event, and any location that uses a different hostname. Quota stays per property, so 30 properties means 30 separate daily allowances of 200,000 Core tokens.

Rollout checklist

  1. Audit every property for internal traffic filters, (not set) landing pages, and shared hostnames.
  2. Add the service account as a Viewer to each property.
  3. Build the property map and shared definitions.
  4. Test the question library on three properties first.
  5. Tie out one number per property before anyone uses the answers in a report.

Start with one property and one context file

The fastest path to trustworthy GA4 answers is small. Connect one property through Google’s local server or hosted endpoint, write a one page context file, run five questions from your library, and tie each answer to the GA4 interface. Expand to more properties and people only after those numbers match.

Google has made access easy. What decides whether AI saves your team time or puts wrong numbers in a client deck is the definitions layer and the checking habit around it. Build those first, and every assistant you connect later follows the same rules.

If you want help building the context file, access model, and reporting workflows across many properties, Launchcodex builds AI systems like this as part of its analytics and automation work.

How Google Analytics MCP went live

FAQ

Is there an official Google Analytics MCP server?

Yes. Google publishes analytics-mcp, an open source server that runs locally, and documents a hosted endpoint for the Analytics Data API at analyticsdata.googleapis.com/mcp/v1.

Can the GA4 MCP server change my settings?

Not by default. Google says the server handles read requests only. The one write tool, create_property_annotation, needs the –allow-write flag and the analytics.edit scope.

Does it work in ChatGPT or claude.ai on the web?

Not the local server. Web based assistants need a remote MCP connector over HTTPS. Use the hosted endpoint, a self-hosted remote deployment, or a hosted connector.

Is the Google Analytics MCP free?

The server is free. Reports use your property’s Data API quota, which is 200,000 Core tokens per day on standard properties. Most requests charge 10 or fewer tokens.

Can it show which Google searches brought visitors?

No. GA4 has no dimension for organic search queries. Connect Search Console for queries, impressions, and positions.

Should I use Analytics Advisor instead?

Use Analytics Advisor for quick questions inside GA4. Use MCP when you want GA4 inside the assistant where your other tools, files, and workflows already live.

Share:
Launchcodex author image - Tanner Medina
About the Author
Tanner Medina
Co-Founder & Chief Growth Officer
Tanner leads growth, strategy, and marketing operations. He helps brands build scalable systems across SEO, AI, and content that generate qualified pipeline. He focuses on frameworks that connect effort to revenue.
Launchcodex blog spaceship

Join the Launchcodex newsletter

Practical, AI-first marketing tactics, playbooks, and case lessons in one short weekly email.
Weekly newsletter only. No spam, unsubscribe at any time.
Envelopes

Want results like these? Let’s build your case study next.

If you're ready for smarter systems, scalable strategy, and results that move the needle, let’s talk.

Explore more insights

Real stories from the people we’ve partnered with to modernize and grow their marketing.