# Google Analytics (MCP Server)

> Run GA4 reports and realtime queries from your AI assistant

- Type: MCP server
- Publisher: Google Analytics (official)
- Categories: Data & Analytics, Marketing
- Website: https://github.com/googleanalytics/google-analytics-mcp
- Source: https://github.com/googleanalytics/google-analytics-mcp
- Transport: stdio
- Launch command: pipx run analytics-mcp
- Sign-in: oauth
- Environment variables: GOOGLE_APPLICATION_CREDENTIALS, GOOGLE_PROJECT_ID
- GitHub stars: 3469
- Listed: 2025-07-16

## About

Google's experimental Google Analytics MCP server uses the GA Admin and Data APIs to list accounts and properties, run standard, funnel and realtime reports, and read custom dimensions and metrics. It runs locally via pipx and authenticates with Google Application Default Credentials from gcloud.

## Install

1. **Add the server to Codex**

   Codex CLI:

   ```bash
   codex mcp add google-analytics --env GOOGLE_APPLICATION_CREDENTIALS=YOUR_GOOGLE_APPLICATION_CREDENTIALS --env GOOGLE_PROJECT_ID=YOUR_GOOGLE_PROJECT_ID -- pipx run analytics-mcp
   ```

   config.toml:

   ```toml
   [mcp_servers.google-analytics]
   command = "pipx"
   args = ["run", "analytics-mcp"]
   
   [mcp_servers.google-analytics.env]
   GOOGLE_APPLICATION_CREDENTIALS = "YOUR_GOOGLE_APPLICATION_CREDENTIALS"
   GOOGLE_PROJECT_ID = "YOUR_GOOGLE_PROJECT_ID"
   ```

   Agents SDK:

   ```python
   from agents import Agent, Runner
   from agents.mcp import MCPServerStdio
   
   async with MCPServerStdio(
       name="Google Analytics",
       params={"command": "pipx", "args": ["run", "analytics-mcp"]},
   ) as server:
       agent = Agent(name="Assistant", mcp_servers=[server])
       result = await Runner.run(agent, "What were the top 10 landing pages by sessions last week?")
       print(result.final_output)
   ```

## Tools

- `get_account_summaries`
- `get_property_details`
- `list_google_ads_links`
- `run_report`
- `run_funnel_report`
- `get_custom_dimensions_and_metrics`
- `run_realtime_report`

## Example prompts

- "What were the top 10 landing pages by sessions last week?"
- "How many users are on the site right now?"
- "Compare conversions by channel this month vs last month"
- "Which custom dimensions are defined on my GA4 property?"

## Related

- [Supabase](https://chatgptplugins.directory/mcp/supabase.md): Manage Supabase databases, migrations, edge functions and logs
- [Graphiti MCP](https://chatgptplugins.directory/mcp/graphiti.md): Temporal knowledge graph memory for agents, by Zep
- [WordPress.com](https://chatgptplugins.directory/mcp/wordpress-com.md): Draft, edit and manage posts, pages and comments on your WordPress.com sites
- [MCP Toolbox for Databases](https://chatgptplugins.directory/mcp/mcp-toolbox-databases.md): Google's open-source MCP server for 20+ databases
- [PostHog](https://chatgptplugins.directory/mcp/posthog.md): Query product analytics, feature flags, experiments and errors in PostHog
- [Apify](https://chatgptplugins.directory/mcp/apify.md): Run thousands of Apify Actors for scraping and automation from your agent

---
Source: https://chatgptplugins.directory/mcp/google-analytics · Index: https://chatgptplugins.directory/llms.txt · Independent and community-run. Not affiliated with or endorsed by OpenAI. ChatGPT is a trademark of OpenAI.
