Official Data & Analytics

Google Analytics 4

Pull GA4 reports, audiences, and metrics into your AI client.

Works with: Claude DesktopClaude CodeCursor

Official server · page last edited

How to install the Google Analytics 4 MCP server

Add this to your Claude Desktop MCP configuration:

Set up Application Default Credentials with the analytics.readonly scope, then run pipx run analytics-mcp from your client. Requires pipx.

Add this to your Claude Code MCP configuration:

Set up Application Default Credentials with the analytics.readonly scope, then run pipx run analytics-mcp from your client. Requires pipx.

Add this to your Cursor MCP configuration:

Set up Application Default Credentials with the analytics.readonly scope, then run pipx run analytics-mcp from your client. Requires pipx.

Built by ContextBoltPair Google Analytics 4 with ContextBolt SEO: live keyword, ranking, and competitor data, right inside your agent.

See ContextBolt SEO

The GA4 MCP server gives Claude direct access to your Google Analytics 4 data. Pull reports, ask why something changed, generate weekly summaries, all from plain-English prompts. For anyone running GA4, this is the highest-leverage analytics install in the directory.

GA4’s UI is dense and non-obvious. The MCP server side-steps that entirely. You ask the question, Claude writes the right Data API query, you get the answer.

Why use it

The reason most people don’t use GA4 effectively isn’t lack of data, it’s friction. Building a custom report takes a half-hour the first time and you forget how to do it the next time you need it. Each insight has a tax.

The MCP server removes the tax. “Compare landing-page conversions across these three sources, last 14 days vs the 14 before that” goes from a 20-minute UI session to a five-second prompt.

What it actually does

Run any standard GA4 report: pick metrics, dimensions, filters, date ranges. Run realtime reports for the last 30 minutes. Pull audience definitions and segment-level data. Some servers also expose the Admin API, which lets you list properties, streams, and custom dimensions.

Practical patterns:

  • “What were our top 10 landing pages by conversion rate last month?”
  • “Compare organic search traffic this week vs the same week last year, broken down by page.”
  • “Why is bounce rate up 8% on /pricing? Show me by source and device.”

Gotchas

GA4 has data sampling thresholds. For high-traffic properties, queries that return aggregated data over long windows can be sampled. The server returns the data Google gives it; Claude won’t know it’s sampled unless you ask. For exact numbers, set the date range smaller or use the Data API’s keepEmptyRows parameter.

Custom dimensions are property-specific. Claude can list them via the Admin API but won’t know what each one means in your business context. Add a brief description in your system prompt if custom dimensions matter for your workflows.

Pair with Search Console for the SEO loop: GSC for what people searched, GA4 for what they did after they landed. Claude can join the two in a single prompt: “what queries are bringing traffic that converts above average?”

For deeper data work where you need to join GA4 with your app database, pipe GA4 to BigQuery (built-in feature) and query both via the BigQuery MCP server. SQL gives you joins the GA4 UI can’t do.

Built by ContextBolt

Pair Google Analytics 4 with ContextBolt SEO

Google Analytics 4 is one piece of your marketing stack. ContextBolt SEO is another: a hosted MCP server that brings live keyword research, difficulty scores, SERP breakdowns, and competitor analysis into the same conversation, so your agent can tell you what to target before you publish. Every lookup saves automatically to a private SEO Dashboard. $35 a month.

See ContextBolt SEO →

Google Analytics 4 MCP server: FAQs

Is the GA4 server official?

Yes. Google publishes an experimental local server, analytics-mcp, in the googleanalytics/google-analytics-mcp repository. It uses the Google Analytics Admin and Data APIs. Community implementations exist too.

What does it need to authenticate?

Google's server uses Application Default Credentials for a user who has access to your Google Analytics properties, and the credentials need the Google Analytics read-only scope. Community servers may support a service account JSON file instead.

What metrics can it pull?

Anything in the GA4 Data API: page views, sessions, users, conversions, custom events. Filters and dimensions work the same as in the GA4 UI. The most useful pattern is to write the query in plain English and let Claude translate it into the right Data API call.

Can it pull realtime data?

Yes, most servers expose the Realtime Reporting API endpoint. Note this is different from the standard reports and the data shape is more limited (last 30 minutes only, fewer dimensions).

How does this compare to Looker Studio or a custom dashboard?

The MCP server is for ad-hoc analysis: 'why did traffic dip yesterday?' Looker Studio is for recurring dashboards. They're complementary. Most teams want the dashboard for trends and the MCP server for diagnosis.