# Google Analytics 4 MCP Server

> Query and analyze GA4 data through AI assistants.

- **URL**: https://followmcp.com/en/servers/surendranb-google-analytics-mcp
- **Category**: Other
- **Origin**: Community
- **Stars**: 242
- **FMRS Score**: 52/100 (Grade D)
- **Source**: https://github.com/surendranb/google-analytics-mcp
- **Transports**: stdio (local process)
- **Runtimes**: Python
- **Auth**: API key / credential required

## Overview
This MCP server connects AI assistants to Google Analytics 4 data about website traffic, user behavior, and performance. It offers report queries, dimension and metric discovery, server-side aggregation, and analytical guides.

## Best for
- Analysts and teams that need to query GA4 properties through AI assistants.
- Workflows that benefit from GA4 schema discovery and server-side aggregation.

## Not for
- Users without access to a GA4 property or Google Cloud service account credentials.
- Workflows that need to query data sources other than Google Analytics.

## Required permissions
- Requires a Google Cloud service account JSON key with access to the target GA4 property, along with its numeric property ID.

## Risks
- The README says telemetry is on by default. Boot and tool events send some configuration, tool execution details, and error categories. Calls to get_ga4_data also send the intent and dimension and metric names; search_skills sends its query.
- An incorrect property ID, credential file, or access grant can prevent setup or queries from succeeding.

## Client config (JSON)
```json
{"mcpServers":{"google-analytics":{"command":"uvx","args":["google-analytics-mcp"],"env":{"GA4_PROPERTY_ID":"your_ga4_property_id","GOOGLE_APPLICATION_CREDENTIALS":"/path/to/service_account.json"}}}}
```

## Tools (12)
- `get_ga4_data`: Runs multidimensional GA4 reports with metric totals and server-side aggregation.
- `list_properties`: Lists GA4 properties; returns the configured property when GA4_PROPERTY_ID is set.
- `search_schema`: Ranks relevant dimensions and metrics for a keyword, returning up to 10 results.
- `get_property_schema`: Returns the full dimension and metric schema for the configured property.
- `list_dimension_categories`: Lists dimension categories and their counts.
- `list_metric_categories`: Lists metric categories and their counts.
- `get_dimensions_by_category`: Returns dimensions in a category with API names and descriptions.
- `get_metrics_by_category`: Returns metrics in a category with API names and descriptions.
- `search_skills`: Fetches analytical recipes and guides for traffic diagnosis, attribution, ecommerce, AI referrals, and bot detection.
- `get_troubleshooting_guide`: Provides a troubleshooting guide for setup, IAM/403, or schema errors.
- `setup_ga4_access`: Interactively fixes property ID, credentials, or access issues and reinitializes the server.
- `check_for_updates`: Checks PyPI for a newer release and provides upgrade instructions.
