# Google Analytics 4 [Health: Active]

**Category:** 🎯 Marketing  
**Repository:** https://github.com/get-mcp-ads/google-analytics-mcp-server  
**GitHub Stars:** 0  
**npm Downloads (last month):** 949  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/google-analytics-4

## Description
Google Analytics 4: 27 read-only tools across the Data API and the Admin API.

## Tools
Capabilities this server exposes over MCP:

- **ga4_health_check** — Read-only GA4 health check. Verifies configured credentials, accessible properties, and metadata/property access without exposing OAuth tokens.
- **ga4_list_properties** — List all GA4 properties accessible with the current credentials. Returns property ID, display name, timezone, and currency.
- **ga4_run_report** — Run a GA4 analytics report with intelligent query planning. Supports 52 metrics, 63 dimensions, auto-pagination.
Use ga4://metrics and ga4://dimensions resources for available fields. Max 9 dimensions + 10 metrics per request.
- **ga4_run_realtime_report** — Run a read-only GA4 Data API realtime report. Realtime supports only a limited subset of dimensions and metrics.
- **ga4_get_metadata** — Get the complete list of dimensions and metrics available for a specific GA4 property. Useful for discovering custom dimensions/metrics.
- **ga4_get_custom_definitions** — List custom dimensions and custom metrics exposed by GA4 Data API metadata. Read-only fallback for custom definition inventory.
- **ga4_get_key_events** — Inventory GA4 key events/conversions using metadata-aware Data API reports. Returns best-effort event names and counts.
- **ga4_get_ecommerce_diagnostics** — Read-only ecommerce coverage diagnostics for core ecommerce events, revenue metrics, and item-level reporting over a date range.
- **ga4_get_event_parameters** — Best-effort event parameter inventory from GA4 metadata plus event reports. Documents Data API limitations for raw parameters.
- **ga4_run_funnel_recipe** — Run a read-only configurable funnel recipe using one GA4 report per eventName/pagePath step and return simple step counts.
- **ga4_get_audience_export_diagnostics** — Read-only Audience Export diagnostics. Lists existing audience exports, state counts, and optionally samples rows from an existing export.
- **ga4_get_audience_diagnostics** — Read-only audience diagnostics from Admin API audiences, Data API recurring audience lists, and observed audienceName report fallback.
- **ga4_get_bigquery_export_diagnostics** — Detect GA4 BigQuery export links and diagnose export modes, stream coverage, excluded events, and dataset location.
- **ga4_get_server_side_tagging_diagnostics** — Best-effort read-only server-side tagging diagnostics from data streams, Measurement Protocol secrets, event rules, and stream settings.
- **ga4_run_advanced_funnel_report** — Run the GA4 Data API v1alpha runFunnelReport endpoint with optional breakdown/next-action, falling back to read-only step counts if unavailable.
- **ga4_get_channel_groups** — List custom channel groups defined for a GA4 property.
- **ga4_validate_query** — Validate a metric/dimension combination BEFORE executing. Checks max limits (9 dims, 10 metrics), ecommerce rules, and dimension compatibility.
- **ga4_run_pivot_report** — Run a read-only GA4 Data API pivot report with native filters, ordering, quota state, multiple date ranges, and up to 250,000 pivot cells. Every pivot requires an explicit limit.
- **ga4_batch_run_reports** — Run 1-5 independent read-only GA4 Core reports for the same property in one official Data API batch request.
- **ga4_batch_run_pivot_reports** — Run 1-5 independent read-only GA4 pivot reports for the same property in one official Data API batch request.
- **ga4_check_compatibility** — Ask the official GA4 Data API which dimensions and metrics are compatible with a proposed Core report selection.
- **ga4_get_property_quotas_snapshot** — Read the current GA4 Data API property quota snapshot from the official v1alpha endpoint. This does not run a report, but Google still charges one property-quota token to the category with the most remaining quota.
- **ga4_list_accounts** — List raw GA4 Analytics Admin accounts accessible to the authenticated user (read-only, auto-paginated).
- **ga4_list_admin_resources** — List an allowlisted GA4 Admin collection in read-only mode: streams, custom definitions, key events, audiences, product links, annotations, channel groups, expanded datasets, subproperty/rollup configuration, and access bindings.
- **ga4_get_property_configuration** — Read GA4 property details plus selected singleton Admin settings (attribution, retention, Google Signals, reporting identity, or user-provided-data settings).
- **ga4_list_audience_exports** — List existing GA4 Audience Export snapshots and Recurring Audience Lists without creating new exports.
- **ga4_query_audience_export** — Query rows from an existing GA4 Audience Export. User/device identifiers are redacted by default; include them only through explicit opt-in.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "google-analytics-4": {
    "command": "npx",
    "args": ["-y","@getmcpads/google-analytics-mcp-server"],
    "env": {
      "GA4_CLIENT_ID": "",
      "GA4_CLIENT_SECRET": "",
      "GA4_REFRESH_TOKEN": "",
      "GA4_PROPERTY_ID": ""
    }
  }
}
```

**Requires environment variables:** `GA4_CLIENT_ID`, `GA4_CLIENT_SECRET`, `GA4_REFRESH_TOKEN`, `GA4_PROPERTY_ID` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Google Analytics 4 MCP server does

Google Analytics 4 MCP server exposes read-only access to Google Analytics 4 through the Data API and Admin API. It provides 27 tools for discovering accessible accounts and properties, running reports, inspecting configuration, and diagnosing common analytics setup issues. No tool creates, edits, or deletes GA4 resources.

Reporting tools cover standard reports, realtime reports, pivot reports, batch report requests, configurable funnels, and the Data API v1alpha funnel endpoint. The server also provides metadata and compatibility checks so an agent can inspect available dimensions and metrics, validate a proposed selection, and check whether a combination is supported before running it.

Administration tools can list accounts, properties, and selected Admin API collections, including data streams, custom definitions, key events, audiences, product links, annotations, channel groups, expanded datasets, access bindings, and subproperty or rollup configuration. Other tools read property-level settings such as attribution, retention, Google Signals, reporting identity, and user-provided-data settings.

## How it works

The server runs as a local stdio MCP process. An MCP client sends tool calls, and the process makes read requests directly to Google’s Data API or Admin API using the configured OAuth credentials. `ga4_health_check` can verify access and show reachable properties without exposing the configured secrets.

A default property can be supplied through `GA4_PROPERTY_ID`; otherwise, calls can identify the property themselves. Query planning, compatibility checks, and quota snapshots help an agent avoid invalid combinations and monitor the Data API property quota. Batch tools accept one to five independent reports or pivot reports for the same property.

Personal identifiers are redacted by default in access bindings and audience export results. The relevant tools accept an explicit opt-in to include them. Report results are not redacted, so callers should avoid requesting identifiers as report dimensions when conversation data may leave the local environment.

## Setup and configuration

To run the Google Analytics 4 MCP server locally, use Node.js 22.12 or newer. In a Google Cloud project, enable the Google Analytics Data API and Google Analytics Admin API, then create a desktop OAuth client. Complete the consent flow with a Google account that can access the required properties and retain the resulting refresh token. The documented scope is `analytics.readonly`.

The source-release installation sequence is:

```bash
git clone --branch v2.0.0 --depth 1 https://github.com/getmcpads-com/google-analytics-mcp-server.git
cd google-analytics-mcp-server
npm ci
npm run build
```

Configure the client to run Node with the absolute path to `dist/cli.js`, or use the npm package command shown in the client configuration. Set `GA4_CLIENT_ID`, `GA4_CLIENT_SECRET`, and `GA4_REFRESH_TOKEN`. `GA4_PROPERTY_ID` is optional and supplies a default property. Run the health check after configuration.

## Tools and capabilities

- Discover accessible accounts, properties, Admin resources, and property settings.
- Run core, realtime, pivot, batch, and funnel reports.
- Inspect dimensions, metrics, custom definitions, key events, channel groups, and compatibility rules.
- Diagnose ecommerce coverage, audience exports, BigQuery export links, server-side tagging, and property quotas.
- List existing audience export snapshots and recurring audience lists, then query existing export rows.
- Read six catalog resources covering metrics, dimensions, compatibility rules, and workflow recipes.

## Limitations and notes

The Google Analytics 4 MCP server is read-only by design. It cannot create audience exports, modify properties, edit data streams, or perform other writes. The standalone repository provides native API tools; hosted product features and MCP Apps interfaces are outside this release.

GA4 access is limited by the authenticated Google account and the APIs enabled in its Cloud project. The refresh token is sensitive and should be stored and managed accordingly. Reports can still return identifiers if they are explicitly requested as dimensions, because report rows are not subject to the export-specific redaction behavior.

The source release requires Node.js 22.12 or later and drops Node.js 18 and 20 support. The release instructions also distinguish the pinned GitHub source version from separately published npm and MCP Registry versions.

_Full upstream README: https://allmcps.com/mcp/google-analytics-4/readme_

