# Google Analytics 4

This MCP server lets an agent read GA4 reports, funnels, and property settings. Use it to explore analytics from Claude Code without write access.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI
- Author: get-mcp-ads
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/get-mcp-ads/google-analytics-mcp-server
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/get-mcp-ads-google-analytics-4

## What it does

The server offers 27 tools for reading Google Analytics 4 data, including reports, funnels, realtime data, and property settings. It can check metric and dimension combinations before an API request, and show a property’s quota snapshot. There are no tools for changing data.

You need GA4 credentials set as `GA4_CLIENT_ID`, `GA4_CLIENT_SECRET`, and `GA4_REFRESH_TOKEN`. The server runs through `npx` and requires Node.js `22.23.4`, `24.22.1`, or `26.12.1` or newer within those release lines. An older Node.js version triggers a startup warning. Claude Code connects to it over MCP using stdio.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `GA4_CLIENT_ID`, `GA4_CLIENT_SECRET`, `GA4_REFRESH_TOKEN`, `GA4_PROPERTY_ID`, `GA4_PROPERTY_IDS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env GA4_CLIENT_ID=<GA4_CLIENT_ID> --env GA4_CLIENT_SECRET=<GA4_CLIENT_SECRET> --env GA4_REFRESH_TOKEN=<GA4_REFRESH_TOKEN> --env GA4_PROPERTY_ID=<GA4_PROPERTY_ID> --env GA4_PROPERTY_IDS=<GA4_PROPERTY_IDS> --transport stdio get-mcp-ads-google-analytics-4 -- npx -y @getmcpads/google-analytics-mcp-server
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add get-mcp-ads-google-analytics-4 --env GA4_CLIENT_ID=<GA4_CLIENT_ID> --env GA4_CLIENT_SECRET=<GA4_CLIENT_SECRET> --env GA4_REFRESH_TOKEN=<GA4_REFRESH_TOKEN> --env GA4_PROPERTY_ID=<GA4_PROPERTY_ID> --env GA4_PROPERTY_IDS=<GA4_PROPERTY_IDS> -- npx -y @getmcpads/google-analytics-mcp-server
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "get-mcp-ads-google-analytics-4": {
            "command": "npx",
            "args": [
                "-y",
                "@getmcpads/google-analytics-mcp-server"
            ],
            "env": {
                "GA4_CLIENT_ID": "<GA4_CLIENT_ID>",
                "GA4_CLIENT_SECRET": "<GA4_CLIENT_SECRET>",
                "GA4_REFRESH_TOKEN": "<GA4_REFRESH_TOKEN>",
                "GA4_PROPERTY_ID": "<GA4_PROPERTY_ID>",
                "GA4_PROPERTY_IDS": "<GA4_PROPERTY_IDS>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "get-mcp-ads-google-analytics-4": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@getmcpads/google-analytics-mcp-server"
            ],
            "env": {
                "GA4_CLIENT_ID": "<GA4_CLIENT_ID>",
                "GA4_CLIENT_SECRET": "<GA4_CLIENT_SECRET>",
                "GA4_REFRESH_TOKEN": "<GA4_REFRESH_TOKEN>",
                "GA4_PROPERTY_ID": "<GA4_PROPERTY_ID>",
                "GA4_PROPERTY_IDS": "<GA4_PROPERTY_IDS>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e GA4_CLIENT_ID=<GA4_CLIENT_ID> -e GA4_CLIENT_SECRET=<GA4_CLIENT_SECRET> -e GA4_REFRESH_TOKEN=<GA4_REFRESH_TOKEN> -e GA4_PROPERTY_ID=<GA4_PROPERTY_ID> -e GA4_PROPERTY_IDS=<GA4_PROPERTY_IDS> get-mcp-ads-google-analytics-4 npx -y @getmcpads/google-analytics-mcp-server
```
Replace <…> with your own values

## When to use it
- inspect GA4 traffic and conversions
- check metric and dimension compatibility before querying
- review funnel reports and realtime data
- check a property’s GA4 quota
- read property and data stream settings

## Example prompts
- Show the conversion report for my GA4 property.
- Check whether these GA4 metrics and dimensions work together.
- Check the remaining query quota for my GA4 property.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89609
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89899
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16730
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40459
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27844
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49863

## Other versions with the same name
- [Google Analytics 4 · mindstone](https://affpapa.org/en/nevibecode/mcp/google-analytics-4.md) — ★ 13

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
