TutorialClaudeGoogle Analytics 4

Google Analytics MCP: set up the official server

Use Google’s official Google Analytics MCP server, or Porter’s free connector: connect GA4 in Porter, paste one URL into Claude’s Connectors and sign in. Then ask about sessions, sources and key events in a normal chat. About 5 minutes, no code.

Connect Google Analytics 4 free
https://mcp.portermetrics.com/mcp
SEO and AI SEO Specialist, Porter Metrics · Updated November 24, 2026 · 9 min read
Google Analytics 4 logoGoogle Analytics 4
Porter logoPorter MCP
Claude logoClaude
ClaudeMCPConnected
Which channels drove the most key events last week?
Porter · Google Analytics 4 · trailgear.com✓ 10 rows
Paid search drove 312 key events, more than any other channel.
google / cpc312
google / organic188
newsletter / email96
Demo data · fictional brand
✓Answer ready in 4s
Quick answer: 5 steps, about 5 minutes, free
  1. Sign up free at Porter and connect Google Analytics 4 with your Google sign-in.
  2. In Claude, open Customize, then Connectors, click + Add and choose Add custom connector.
  3. Name it Porter Metrics and paste https://mcp.portermetrics.com/mcp.
  4. Click Connect, sign in to Porter and allow access.
  5. Open a new chat and ask about sessions, sources or key events.
How to connect Google Analytics 4 to Claude in 5 steps: connect GA4 in Porter, open Connectors in Claude, paste Porter’s MCP URL, allow access, ask about your traffic
VIDEO · WATCH THE SETUPHow to connect Google Analytics 4 to Claude (no code)Porter Metrics on YouTube

Is there an official Google Analytics MCP?

Yes. Google publishes an official Google Analytics MCP server. It’s free and only reads data, but you run it yourself: it needs a Google Cloud project, two APIs turned on and Python. Porter’s connector reads the same GA4 data with no setup, works in claude.ai, and puts GA4 next to your ad platforms.

MethodSetupRead or writeWorks inFree?Best for
Porter connector (MCP)5 minutes, no codeReads, and adds key events, dimensions or audiences after you approveclaude.ai, Claude Desktop, Cowork, Claude CodeFree plan, last 15 daysMost people
Google’s official MCP server1 hour or moreRead onlyClaude Desktop, Claude Code and other local clientsYesDevelopers comfortable with Google Cloud
CSV export from GA410 minutes each timeRead only, a snapshotAny Claude chatYesA one-off analysis

Comparing MCP options in more detail? See Porter’s Google Analytics 4 MCP server.

Before you start

  • A Google account with at least Viewer access to the GA4 properties you want
  • Claude on any plan. The Free plan allows one custom connector
  • A free Porter account
Time neededAbout 5 minutes
Works inclaude.ai, Claude Desktop, Cowork, Claude Code
CostFree plan, no card

How to connect Google Analytics 4 to Claude (claude.ai)

1

Connect GA4 in Porter

Sign up free at Porter, open Data sources and choose Google Analytics 4. Sign in with Google, allow access, then select the properties Claude should read.

Porter's Google Analytics 4 authorization screen with connected Google accounts and the Next button

Your Google accounts are connected in Porter. Click Next and pick your properties.

2

Open Connectors in Claude

In Claude, open Customize, then Connectors, click + Add and choose Add custom connector.

Customize › Connectors › + Add › Add custom connectorAdd

Where to find custom connectors in Claude.

3

Paste Porter’s MCP URL

Name it Porter Metrics and paste this URL, then click Add:

SERVER URL
https://mcp.portermetrics.com/mcp
Claude's Add custom connector window with the name Porter Metrics and Porter's MCP URL filled in

Claude, Customize, Connectors, Add custom connector.

4

Sign in and allow access

Click Connect next to Porter Metrics, sign in with the Google account you use in Porter and allow access.

Porter's Application Access Request screen asking you to let Claude use the Porter MCP server

Porter asks you to allow Claude to use the Porter MCP server.

Porter Metrics listed as a connected connector in Claude

Porter Metrics connected in Claude.

5

Ask your first question

Open a new chat and try: “Which sources brought the most sessions and key events in the last 14 days?”

ClaudePorter connected
Which sources brought the most sessions and key events in the last 14 days?
Porter / Google Analytics 4 / trailgear.com✓ 10 rows
Google organic brought 8,420 sessions, but Google paid search drove the most key events: 312.
Session source / mediumSessionsKey eventsEngagement rate
google / organic8,42018861%
google / cpc4,96031258%
newsletter / email1,7309672%
Demo data · fictional brand

Claude Desktop, Cowork, Claude Code and Team plans

Add Porter once on claude.ai and it shows up in Claude Desktop and Cowork when you sign in with the same Claude account. The steps are the same on every model, from Opus to Haiku.

Claude Code

Claude Code runs in your terminal, so you add Porter with one command. --scope user makes it available in every project:

COMMAND
claude mcp add --transport http porter https://mcp.portermetrics.com/mcp --scope user

Then type /mcp, pick porter and sign in in the browser tab that opens.

Claude Team and Enterprise plans

On Team and Enterprise, an owner adds Porter first in Organization settings, then Connectors, with the same URL. After that, each member opens Customize, then Connectors, clicks Connect next to Porter Metrics and signs in with their own Porter account.

Connect several GA4 properties

Agencies connect each property in Porter once. Then name the property in your question (“Compare sessions for Brand A and Brand B last month”), or ask for all of them in one table. The Free plan has no limit on connected accounts.

Set up Google’s official Google Analytics MCP server

Google’s Google Analytics MCP server runs on your computer and reads GA4 through the Admin and Data APIs.

What you need

  • A Google Cloud project with the Google Analytics Admin API and Data API turned on
  • Viewer access to your GA4 properties
  • Python 3.10 or later, pipx and the gcloud CLI
  • Google credentials with the Analytics read-only scope

Set it up in Claude Desktop

  1. Sign in by running gcloud auth application-default login with the Analytics read-only scope.
  2. Add the server to claude_desktop_config.json with the config below, using your own file path and project ID.
  3. Restart Claude and ask it to list your GA4 accounts.
CONFIG
{"mcpServers":{"analytics-mcp":{"command":"pipx","args":["run","analytics-mcp"],"env":{"GOOGLE_APPLICATION_CREDENTIALS":"PATH_TO_CREDENTIALS_JSON","GOOGLE_CLOUD_PROJECT":"YOUR_PROJECT_ID"}}}}

What it can do

It lists your accounts and properties, runs reports, realtime reports, funnel reports and conversions reports, and reads your custom dimensions and metrics. It only reads, so it can’t change GA4 settings.

We tested it. On November 24, 2026 we installed version 1.1.0 from GitHub and listed its tools. It has ten, and all of them only read: get_account_summaries, get_property_details, list_google_ads_links, list_property_annotations, list_key_events, get_custom_dimensions_and_metrics, run_report, run_realtime_report, run_funnel_report and run_conversions_report.

What you can do once GA4 is connected

  • Traffic reporting: sessions, users and views by source, medium, campaign or landing page.
  • Key events: which channels and pages drive key events and revenue.
  • Content: top pages by views and engagement rate.
  • Setup changes: Claude can mark events as key events and create custom dimensions or audiences. It asks you before each change.
  • Ads and site in one view: compare GA4 with Google Ads in Claude, Meta Ads or Search Console.

First prompts to run

PROMPT · Marketing managersWhich session sources brought the most sessions and key events in the last 14 days?
PROMPT · Marketing managersCompare sessions, engagement rate and key events this week with last week by session source / medium.
PROMPT · Marketing managersWhich landing pages had the most sessions but the lowest engagement rate in the last 14 days?
PROMPT · AgenciesDraft a short weekly client update from the last 7 days of sessions, key events and top sources.
PROMPT · AgenciesWhich client property had the biggest drop in sessions in the last 7 days, and from which source?
PROMPT · AgenciesCompare Google Ads spend with GA4 key events from google / cpc by day for the last 14 days.
PROMPT · SEO and contentList the top 10 pages by views in the last 14 days with their engagement rate.
PROMPT · SEO and contentHow did google / organic sessions change day by day in the last 14 days?
PROMPT · E-commerce marketersShow purchase revenue and session conversion rate by session source for the last 14 days.

Build a Google Analytics dashboard with AI

Ask Claude to turn your GA4 data into a live dashboard with its own link you can share. Porter keeps it synced, so you don’t rebuild it every week.

PROMPT · Dashboard promptBuild me a GA4 dashboard with sessions, engagement rate, key events and revenue by session source, plus the top landing pages, for the last 14 days, and give me a link I can share.
Google Analytics 4 AI dashboard template built with Porter Metrics AI dashboards

Google Analytics 4 AI dashboard template, demo data.

Or browse all dashboard templates.

GA4 metrics Claude can read

Through Porter, Claude reads these Google Analytics 4 fields, among others:

  • Sessions, engaged sessions and engagement rate
  • Key events and session conversion rate
  • Views, views per session and user engagement
  • Purchase revenue and total revenue
  • Session source, medium and source / medium
  • Landing page, page path and page title
  • First user source and medium

See every Google Analytics 4 field in Porter

Troubleshooting

Porter doesn’t show in my chat.

Open the tools menu in the chat and turn Porter Metrics on, or start a new chat after adding it.

Authorization failed.

Remove the connector, add it again and sign in with the same Google account you use in Porter.

My GA4 property isn’t listed.

Check that the Google account you used in Porter has at least Viewer access to the property in GA4. Universal Analytics properties no longer work.

The numbers don’t match GA4.

Check the date range and the property time zone. GA4 can take a day or two to finish processing, and reports with many rows may be sampled or grouped as (other).

The official server can’t find my property.

Turn on the Analytics Admin and Data APIs in your Google Cloud project and give your account Viewer access to the property.

Is the Google Analytics MCP safe?

Both routes use Google sign-in and the official Analytics APIs, so Claude never sees your password, and you can remove access from your Google account at any time. Keep these rules:

  1. Give access only to the properties Claude needs.
  2. Review any key event, dimension or audience before Claude creates it.
  3. Use a read-only account if you only need reports.
  4. Keep personal data out of chats you share with others.
i

Porter reads through Google’s official Analytics APIs, and Claude asks you before it changes anything in GA4.

Frequently asked questions

Is there an official Google Analytics MCP?

Yes. Google publishes an official Google Analytics MCP server (analytics-mcp). It runs on your computer with Python, uses your Google Cloud credentials and can run GA4 reports, realtime reports and funnel reports. It only reads data.

Is it free to connect Google Analytics to Claude?

Yes. Google’s server is free. Porter has a free plan with the last 15 days of data in Claude, and questions that only read data use no AI credits.

Can Claude change my GA4 settings?

Google’s official server can’t; it only reads. With Porter, Claude can mark events as key events and create custom dimensions or audiences, and it asks you before each change.

Do I need Google Cloud for the official server?

Yes. You need a Google Cloud project with the Analytics Admin and Data APIs turned on, the gcloud CLI and Python. Porter needs none of that; you sign in with Google.

Does it work in ChatGPT?

Porter’s MCP URL works as a ChatGPT connector too. Google’s server runs locally, so it works in desktop and coding tools that run local MCP servers.

Related tutorials

Ready to chat with your Google Analytics 4 data?

Connect it to Claude and ask your first question today.

Google Analytics 4 dashboard built in Claude with Porter, demo dataStart free
Kashmala Malik
About the author

SEO and AI SEO Specialist at Porter Metrics. She writes Porter’s guides on connecting marketing data to Claude and ChatGPT.

Last updated November 24, 2026