Skip to content
, ,

How to ask Claude questions about your Google Analytics data with Google’s free MCP server

8 min read
Featured image for a guide to Google's Analytics MCP server: bar chart with a plug, and the Google Analytics, Claude and MCP logos.

Google offers a free add-on that lets Claude look up your website statistics in Google Analytics and answer questions about them in plain English, such as which pages keep visitors longest. It can only look, not change anything, unless you deliberately turn on a few extra features, and setting it up takes about half an hour.

Imagine you want to know which of your pages hold search visitors longest. In Google Analytics that means finding the right report, limiting it to visitors from search engines, listing them by the first page they saw and sorting by time spent. With the connector you type the question to Claude, and Claude builds that report for you, runs it and reads the answer back, with the numbers you can check.

This guide covers what the add-on is, how to set it up so it can only read your data, what Claude can do with it, a worked example on this site’s own data, and the checks to run before you trust an answer. If your Google Analytics numbers are swollen by automated visits, read our guide on seeing your real readers when bots flood your numbers first, because the add-on reads whatever Google Analytics holds.

What is this connector?

It is a small program from Google that connects AI assistants to the Google Analytics APIs, the doorways programs use to read data from Google Analytics 4 (GA4), the current version of Google Analytics. MCP, the Model Context Protocol, is an open standard that lets assistants such as Claude use outside tools in a consistent way. Our guide on letting Claude read a company database safely explains MCP in more depth.

The project lives on GitHub as googleanalytics/google-analytics-mcp under the Apache 2.0 licence, which allows free use including at work. When we checked on November 15, 2026, it had about 3,800 stars, its latest release was 1.1.0 from November 6, 2026, and its last update was on November 9, 2026. Google’s own developer guide walks through setup for Claude, Gemini, Cursor and other tools.

This site set it up on November 7, 2026 for its own audience analysis, and the worked example below comes from that setup.

What can Claude do with it?

It can list your accounts and properties, run standard and realtime reports, run funnel reports and look up your custom dimensions, according to the project’s page on GitHub (checked November 15, 2026). A property is GA4’s name for one website or app’s data.

Tools Claude can call through the Google Analytics MCP server, release 1.1.0: account tools get_account_summaries, get_property_details and list_key_events; report tools run_report, run_realtime_report, run_funnel_report and get_custom_dimensions_and_metrics; write tools create_property_annotation, create_custom_dimension and create_key_event, which are off by default.
Reading is all you need to answer questions.

The read tools are on by default. Release 1.1.0 also added three write tools, for creating annotations, custom dimensions and key events, but the project page says they only work when you start the server with --allow-write and grant the analytics.edit permission. Leave them off. Answering questions needs nothing more than reading.

How to set it up with read-only access

You need Python, a Google Cloud project with two APIs switched on, read-only credentials and one command to add the server to Claude. The steps come from the project page and Google’s setup guide, both checked November 15, 2026.

Four steps to set up Google's Analytics MCP server, from the README and Google's guide checked November 15, 2026: install Python 3.10 or newer and pipx or uv; enable the Google Analytics Admin API and Data API in a Google Cloud project; sign in with the analytics.readonly scope or use a service account with the Viewer role; add it to Claude with one claude mcp add command or a JSON block. Write tools stay off unless started with --allow-write and the analytics.edit scope.
About half an hour, most of it in Google Cloud settings.
  1. Install the tools. Python 3.10 or newer, and pipx or uv, which run Python programs in their own space without disturbing anything else on your computer.
  2. Switch on two APIs in a Google Cloud project: the Google Analytics Admin API and the Google Analytics Data API.
  3. Create read-only credentials. Either sign in with your own Google account using the analytics.readonly permission, or create a service account, a separate robot login for programs, and give it the Viewer role on your GA4 property.
  4. Add the server to Claude. For Claude Code, the project page gives one command, shown below with placeholders.
claude mcp add analytics-mcp \
  --scope user \
  -e "GOOGLE_APPLICATION_CREDENTIALS=PATH_TO_CREDENTIALS_JSON" \
  -e "GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID" \
  -- pipx run analytics-mcp

Replace the two placeholders with the full path to your credentials file and your Google Cloud project ID. For Claude Desktop, the same settings go into its configuration file as a short JSON block, a plain text format for settings; Google’s guide shows it.

Why read-only matters

A service account with only the Viewer role cannot change anything in GA4, even if a request asks it to. That is a safety net at the permission level, not just a promise in the software. It also means you can hand the setup to a colleague without worrying that a badly worded question will rename a property or delete a key event.

A worked example on this site’s data

Here is a question asked of this site’s own GA4 property: “Which landing pages keep search visitors longest?” Claude turned it into a single run_report call with landing page as the dimension, only Organic Search sessions, pages with 8 or more sessions, and the date range August 17 to November 14, 2026.

Worked example on this site's GA4 data, August 17 to November 14, 2026, Organic Search only, pages with 8 or more sessions: Jev alternatives 9 sessions, 6 minutes 10 seconds; X subscription explained 12 sessions, 4 minutes 42 seconds; System One models 44 sessions, 3 minutes 35 seconds; home page 62 sessions, 2 minutes 39 seconds; SQL tutorial 11 on stored procedures 10 sessions, 2 minutes 31 seconds; what is grain in data 33 sessions, 2 minutes 27 seconds.
A page with 9 visits can top the list by chance; the 44-session page is the stronger result.

The answer is useful, with one catch you should always look for: sample size. The top page, the Jev alternatives guide, had only 9 search sessions, so its 6 minutes 10 seconds could be two or three unusually patient readers. The System One models explainer, with 44 sessions and 3 min 35 s, is the stronger result, the home page held 62 search visitors for 2 min 39 s on average, and the remaining rows run from 4 min 42 s for the X subscription guide down to 2 min 27 s for the grain explainer, with tutorial 11 of our series on SQL, the language for querying databases, at 2 min 31 s. A follow-up question, “Show only pages with 30 or more search sessions”, is one sentence away.

That is the real advantage of the connector. Asking the next question costs a sentence instead of rebuilding a report, so you are more likely to ask it.

Good questions to start with

The connector is best at the questions you would answer with a standard GA4 report but rarely get round to building. Each question below maps to one report, so the answer is quick to check.

  • “Which landing pages bring the most search visitors, and how long do they stay?” A landing-page report filtered to Organic Search, with sessions and average session time.
  • “How did last month compare with the month before, by channel?” A channel report with two date ranges side by side.
  • “Which countries send visitors who actually engage?” A country report with engagement rate and sessions, which also exposes bot traffic quickly.
  • “How many people are on the site right now, and on which pages?” A realtime report, handy after you share a new post.
  • “What share of visitors reach the end of my guides?” A report on the scroll event by page, if your property records scrolling.

Ask for the session count next to every rate or average in the answer. It turns a list of numbers into a list you can judge, and it costs nothing to add to the question.

Questions it cannot answer

The connector only sees what GA4 records. It cannot tell you why visitors left, what they searched for on Google (that lives in Search Console, a separate Google tool), or anything about visits GA4 never saw because of ad blockers. If Claude answers one of those questions confidently, ask which report it ran; the honest answer is usually that no report covers it.

Who should skip this

If you look at GA4 once a month and the standard reports answer your questions, the setup is more work than it saves. The connector pays off when you ask several follow-up questions a week, or when you want an AI assistant to pull numbers into a written summary for you. It also needs someone comfortable typing commands into a terminal, the text window for running programs, for the first half hour, so in a small team it is worth having one person set it up and share the read-only service account.

How to check the answers

Claude reads real numbers through the API, but it still chooses which report to run, and it can choose wrong. These four checks catch most problems.

  • Ask which report it ran. Have Claude list the dimensions, metrics, filters and dates it used. A missing filter is the most common mistake.
  • Check one number by hand. Open the same report in the GA4 interface and compare one row.
  • Watch the sample sizes. Ask for session counts next to any average or rate, as in the example above.
  • Know your bot traffic. If your property has the bot pattern from our GA4 bot traffic guide, ask Claude to exclude it, or every site-wide average will be wrong.

Common setup problems

Google’s guide lists the errors that come up again and again. Three of them cover almost every failed first attempt.

  • Permission denied. One of the two APIs is not switched on, or the account lacks the Viewer role on the property.
  • Insufficient authentication scopes. The sign-in did not include the analytics.readonly permission; sign in again with it.
  • File not found or command not found. Claude Desktop does not read your terminal’s settings, so use full paths for the credentials file and for pipx, not a path starting with ~.

Common mistakes

  • Switching on write mode “just in case”, when reading is all you need.
  • Using your own admin account instead of a Viewer-only service account.
  • Trusting an average without its session count.
  • Asking site-wide questions on bot-inflated data.
  • Skipping the hand check on the first few answers.

Try it this week

  1. Switch on the two Google Analytics APIs in a Google Cloud project.
  2. Create a service account and give it the Viewer role on your GA4 property.
  3. Add the server to Claude with the command above.
  4. Ask which landing pages keep search visitors longest, with session counts.
  5. Check one row in the GA4 interface, then ask a follow-up question.

Quick recap

  • Google’s Analytics MCP server lets Claude and other assistants read GA4 data.
  • It is free and open source under Apache 2.0, with release 1.1.0 from November 6, 2026.
  • It is read-only by default; write tools need a flag and an extra permission.
  • Setup needs Python, two APIs, read-only credentials and one command.
  • Ask which report it ran, check one number by hand and watch sample sizes.

Sources

Written by

Jose S

Founder & Lead Analyst · Analytics Made Simple

Hands-on data strategist, analytics engineering lead, and educator. Writing practical, no-fluff guides to help everyday teams, analysts, and engineers master SQL, AI systems, and modern data architectures.

Keep going

Same lessons in your feed

Short diagrams, hooks, and weekly tutorials on Substack, Instagram, X, and Facebook.

Google Search Prefer our practical guides in Google Search & Top Stories: