Skip to content

Connect Claude Code to Google Analytics

Connect Claude Code to Google Analytics: 1. Connect Google Analytics in ApexGenius. 2. Add the ApexGenius MCP server. 3. Ask Claude Code.

1,000 free credits · No card required

How to connect Google Analytics to Claude Code

  1. 1Sign in to ApexGenius and connect Google Analytics
  2. 2Add the ApexGenius MCP server to Claude Code
  3. 3Start using Google Analytics in Claude Code

FirstConnect Google Analytics to ApexGenius

ThenConnect ApexGenius to Claude Code

Google Analyticsapexgenius.ai/connections/google_analytics1 of 3

Connect Google Analytics. Google Analytics shows as connected in ApexGenius.

Then ask Claude Code:

List the GA4 properties enabled for me. Do not change anything.

Written setup, step by stepShow

Before you start

  • An account with permission to use the Google Analytics resources you intend to connect.

1. Connect Google Analytics to ApexGenius

  1. Open Google Analytics in Connections. Choose Connect, or Add connection when offered. Give the connection a name if prompted. If Gateway setup pending appears, contact ApexGenius support before continuing.
  2. Choose the account and review access. Choose the Google account with access to your GA4 properties. Review the read-only Analytics access requested by Google and return to ApexGenius.
  3. Review the connected account and resources. Find Allowed resources on the connection page or its Tools tab. Choose Refresh and enable only the GA4 properties you want to report on. Resource selection does not add permissions to the Google account.
  4. Check the connection. Use Test connection or Check again and read the reported status. Add an AI agent from the AI agents page, choose Read only for the first test, and try the question below.
    The actual Google Analytics connection page in ApexGenius, showing its saved connection status.
    This captured Google Analytics connection reports ready. Check your own connection and its latest validation before using tools.Open full-size image (opens in a new tab)
Connect Google Analytics →

2. Connect ApexGenius to Claude Code

Use this server address when adding the connection:

https://server.autom8.pro/mcp
  1. Run claude mcp add --transport http apexgenius followed by the MCP URL above.
  2. Open /mcp and choose ApexGenius.
  3. Approve ApexGenius in your browser.
  4. When ApexGenius asks what this AI client may use, choose Read only for the first test, or Custom to limit it to the tools you need.
  5. Start a new conversation and select ApexGenius from the available tools before asking for live data.
A generated anonymous terminal illustration showing a setup command, ApexGenius added, browser authorization, and ready to use.
Generated terminal example. Use the exact copy button on this page; the image only shows what kind of screen to expect.Open full-size image (opens in a new tab)

3. Verify one safe read

List the GA4 properties enabled for me. Do not change anything.

List the GA4 properties enabled for me. Do not change anything.

Compare the returned account and resource with Google Analytics. Check the connection status separately from the result of the first read.

What Claude Code can do in Google Analytics

5 operations. Read looks things up and changes nothing. There are no write tools, so Claude Code cannot change Google Analytics through ApexGenius.

Read5 operations

Looks things up. Changes nothing.

Properties

  • google_analytics_list_propertiesList the GA4 properties enabled for you in ApexGenius.
  • google_analytics_admin_getRead a property’s settings, such as its data streams and key events.

Reports

  • google_analytics_run_reportRun a report with the dimensions, metrics and dates you choose.
  • google_analytics_run_realtime_reportRun a realtime report on activity in the last 30 minutes.
  • google_analytics_data_requestCall another read-only Data API endpoint for the property, such as its metadata.

You choose what Claude Code can use

When you approve Claude Code, pick Full access, Read only, or Custom. Read only allows the Read operations and nothing else. Custom picks apps and tools one by one.

Limits in Google Analytics

  • · Only the GA4 properties you enable can be reached, and the Google account’s own Analytics access still applies.
  • · The connection asks Google for read-only Analytics access. No tool can change a property, a report or your data.
  • · Turn a tool off to block calls.
  • · Disconnecting stops future access.

What it looks like in Claude Code

An illustrative read-only request and response. Your results come from the account and dates you choose.

How the route works
Claude Code
Claude CodeApexGenius MCP route
List the GA4 properties enabled for me. Do not change anything.
ApexGenius
Working with ApexGenius1 tool search · 1 read
RequestCheck the properties
Account scopeAuthorized connections checked
apex_search_toolsGA4 properties · Find the Google Analytics read routeComplete
apex_call_read_toolgoogle_analytics_list_properties · List enabled propertiesComplete
Claude Code

Illustrative example: two properties are enabled, the main site and the docs site. Pick one before running a report. Nothing was changed.

Read-only route
Claude Code

Try asking

“List the GA4 properties enabled for me. Do not change anything.”

“Compare sessions and conversions by channel for the last 28 days against the 28 days before.”

“How many people are on the site right now, and which pages are they on?”

“Which landing pages lost the most organic sessions this month?”

More connections like this one

One ApexGenius account covers every pair below. Connect an app once and each agent you allow can use it.

Claude Code with other apps

Questions people ask first

How do I connect Google Analytics?

Open Google Analytics in ApexGenius Connections, choose Connect, sign in with the Google account that can see your GA4 properties, and enable the properties you want.

Can my AI change anything in Google Analytics?

No. The connection asks Google for read-only Analytics access, and every tool on this page reads.

Which properties can my AI reach?

Only the GA4 properties you enable in ApexGenius, within the Google account’s own Analytics access.

Does it work with Universal Analytics?

No. It reads GA4 properties through the Google Analytics Data and Admin APIs.

Connect Google Analytics to Claude Code today

Start free

1,000 free credits. No card required. Disconnect any time.