Adray

Google Analytics MCP server

Where does the traffic that actually buys come from, and where do I lose it?

The Google Analytics team publishes an MCP server that reads your GA4 property: reports, funnels and realtime. It is read-only and Google labels it experimental, so use it to explore, not for your monthly report.

What you need

  • Read access to your GA4 property.
  • A Google Cloud project with the Google Analytics Admin API and the Google Analytics Data API enabled.
  • gcloud and pipx installed on your computer.
  • Claude Code or Claude Desktop.

How to connect it

  1. In your Google Cloud project, enable the Google Analytics Admin API and the Google Analytics Data API.

  2. Sign in with read-only Analytics permission. This is the repository's command:

    gcloud auth application-default login \
      --scopes https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/cloud-platform \
      --client-id-file=YOUR_CLIENT_JSON_FILE
  3. Install pipx if you do not have it.

  4. Add the server to Claude Code with your credentials path and project ID:

    claude mcp add analytics-mcp \
      --scope user \
      -e "GOOGLE_APPLICATION_CREDENTIALS=PATH_TO_CREDENTIALS_JSON" \
      -e "GOOGLE_PROJECT_ID=YOUR_PROJECT_ID" \
      -- pipx run analytics-mcp
  5. Open Claude Code and ask for a summary of your properties to confirm it sees the right one.

What to ask it

Copy them as they are. They work best with concrete dates and numbers.

  • Which traffic sources brought the most purchases in the last 90 days, and what is each one's conversion rate?

  • Build this month's funnel of viewing a product, adding to cart, starting checkout and purchasing. At which step do most people drop?

  • Which product pages get lots of visits and almost no purchases? Give me the 10 worst.

  • How many people are on the site right now and where are they coming from?

What it will not tell you

GA4 measures with browser cookies: ad blockers, Safari and anyone who rejects cookies slip past it. That is why its purchases almost never match your store, Meta or Google, and it is not that one of them is broken: each one counts differently.

Before you believe the AI, check it against your orders.

Meta, Google and GA4 each credit themselves with sales on their own terms, and they almost never match what your store recorded. Adray brings all four sources together with your real orders in a single connector for Claude or ChatGPT.