# Google Analytics 4 MCP [Health: Active]

**Category:** 🎯 Marketing  
**Repository:** https://github.com/scalably-io/ga4-mcp  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/google-analytics-4-mcp

## Description
Google Analytics 4 MCP: reports, realtime, funnels, pivots, metadata, admin lists. 17 tools.

## Tools
Capabilities this server exposes over MCP:

- **ga4_list_account_summaries** — List every GA4 account and its child properties accessible to this service account.

    CALL THIS FIRST to discover which property_id to pass into other tools. The SA
    only sees accounts/properties where its email has been explicitly added as a user.

    Response: {"accounts": [{account, display_name, property_summaries: [...], ...}]}.
    Each property_summary has property, display_name, property_type, parent.
    
- **ga4_get_property_details** — Full metadata for a single GA4 property.

    Returns display_name, property_type, parent account, time_zone, currency_code,
    industry_category, service_level, delete_time, expire_time, account reference,
    create_time, update_time.

    property_id: numeric (e.g. "123456789") or resource (e.g. "properties/123456789").
    
- **ga4_list_data_streams** — List all data streams (web, iOS, Android) on a GA4 property.

    Useful for finding the Measurement ID (web), firebase_app_id (mobile),
    or the hostname of a web stream. Each stream has its creation/update timestamps.
    
- **ga4_list_custom_dimensions** — List custom dimensions configured on a GA4 property.

    Each entry contains the parameter_name (how you query it, use prefix
    'customEvent:' or 'customUser:' when passing to get_metadata / run_report),
    display_name, scope (EVENT|USER|ITEM), and description. Essential grounding
    before running reports that reference custom fields.
    
- **ga4_list_custom_metrics** — List custom metrics configured on a GA4 property.

    Each entry: parameter_name, display_name, measurement_unit, scope, restricted_metric_type.
    
- **ga4_list_key_events** — List key events (formerly conversions) on a GA4 property.

    These are the events the client has marked as conversion-worthy. Query
    conversion metrics via `conversions` dimension or direct metric names.
    
- **ga4_list_audiences** — List audiences defined on a GA4 property.

    Each audience has name, display_name, description, membership_duration_days,
    ads_personalization_enabled, event_trigger, exclusion_duration_mode, filter_clauses.
    Reference audienceId as a dimension in run_report for audience-based breakdowns.

    NOTE: Uses Admin v1alpha since audiences are still alpha in April 2026.
    
- **ga4_list_google_ads_links** — List Google Ads links attached to a GA4 property.

    Returns customer_id (the Ads account), can_manage_clients, ads_personalization_enabled,
    and creator_email. Useful to confirm Ads ↔ GA4 cross-reporting availability before
    querying Ads-related dimensions like sessionGoogleAdsCampaignId.
    
- **ga4_list_property_annotations** — List reporting annotations on a GA4 property.

    Annotations are markers (user-added or Google-system) flagging important
    events on a timeline: product launches, outages, marketing pushes, so
    downstream analysis can correlate metric swings with known events.

    Each annotation has: name, title, description, annotation_date,
    annotation_date_range, color, creator_email, system_generated.

    NOTE: Uses Admin v1alpha since annotations are still alpha in April 2026.
    
- **ga4_run_access_report** — Audit log of who-read-what on a GA4 property (last 12 months).

    dimensions (common): userEmail, accessedPropertyName.
    metrics: accessCount.
    date_ranges: list of {start_date, end_date} (YYYY-MM-DD or relative). Defaults to last 7d.

    Use cases: identify usage of GA4 data by staff, confirm SA activity, compliance audits.
    
- **ga4_get_metadata** — Fetch the full GA4 dimension + metric catalog for a property.

    If property_id is omitted, returns the universal catalog (excludes
    property-specific custom fields). Pass a property_id to include custom
    dimensions and metrics like 'customEvent:foo' and 'customUser:signup_plan'.

    Response: {"dimensions": [...], "metrics": [...]}. Each entry has api_name,
    ui_name, description, category, custom_definition.

    Call this before run_report when the agent is uncertain about field names:
    GA4's catalog is large and custom fields require the property to resolve.
    
- **ga4_run_report** — Run a GA4 standard report. The workhorse tool.

    Args:
      property_id: numeric or 'properties/NNN'.
      dimensions: list of dimension api_names (e.g. ["country", "deviceCategory", "date"]).
        Custom dims require 'customEvent:' or 'customUser:' prefixes.
      metrics: list of metric api_names (e.g. ["activeUsers", "sessions", "totalRevenue"]).
      date_ranges: list of {start_date, end_date, name?}. Accepts 'YYYY-MM-DD',
        'NdaysAgo', 'today', 'yesterday'. Up to 4 ranges.
      dimension_filter / metric_filter: filter expression dicts. Shapes:
        {"filter": {"field_name": "country", "string_filter": {"value": "US"}}}
        {"and_group": {"expressions": [...]}}
        {"or_group": {"expressions": [...]}}
        {"not_expression": {...}}
      order_bys: list of {metric: {metric_name}, desc} or {dimension: {...}}.
      metric_aggregations: list of TOTAL|MINIMUM|MAXIMUM|COUNT.
      limit: max rows (hard cap 250000 per response).
      offset: pagination offset.
      keep_empty_rows: include rows where all metrics are zero.
      currency_code: override property default for revenue metrics.
      cohort_spec / comparisons: advanced specs (see REST docs).

    Gotchas surfaced in response.metadata:
      - samplingMetadatas: present if query was sampled (&gt; 10M events scanned)
      - dataLossFromOtherRow: true if high-cardinality dims collapsed into "(other)"
      - schemaRestrictionResponse: active thresholding rules
      - subjectToThresholding: true if user-privacy thresholding dropped rows

    propertyQuota always included so the agent can self-throttle.
    
- **ga4_batch_run_reports** — Run up to 5 GA4 reports in a single round-trip.

    requests: list of run_report-shaped dicts. Same top-level parameters as
    ga4_run_report (minus property_id, inferred from the batch). Each entry
    accepts: dimensions, metrics, date_ranges, dimension_filter, metric_filter,
    order_bys, metric_aggregations, limit, offset, keep_empty_rows, currency_code.

    Useful when the agent needs paired views (e.g. landing pages + referrers
    for the same window) and wants them atomically + under one quota call.
    
- **ga4_run_pivot_report** — Run a GA4 pivot report.

    pivots: list of pivot specs, each with:
      - field_names: list of dimension names to pivot on
      - limit: max rows per pivot
      - offset: pagination offset
      - order_bys: list of OrderBy dicts (same shape as run_report's order_bys)
      - metric_aggregations: list of TOTAL|MINIMUM|MAXIMUM|COUNT

    Use when you want a 2D view: e.g. rows=date, columns=device, values=sessions.
    
- **ga4_run_realtime_report** — Run a GA4 real-time report. Covers the last 30 minutes only.

    IMPORTANT: realtime uses a SEPARATE, smaller dimension/metric catalog. Do NOT
    pass 'date', 'totalRevenue', etc: they don't exist in realtime. Common dims:
    'minutesAgo', 'country', 'deviceCategory', 'unifiedScreenName', 'eventName'.
    Common metrics: 'activeUsers', 'screenPageViews', 'eventCount'.

    minute_ranges: list of {start_minutes_ago, end_minutes_ago, name?}. Max 2
    ranges. Values are 0-29 (0 = now, 29 = 30 min ago).

    For historical / batch reports use ga4_run_report instead.
    
- **ga4_check_compatibility** — Validate whether a dim/metric combo can be queried together. Cheap pre-flight.

    compatibility_filter: 'COMPATIBLE' (default, returns only fields that work
    with the provided selection) or 'INCOMPATIBLE' (returns only fields that
    would conflict).

    Use before run_report when composing exploratory queries, cheaper than
    catching a GoogleAdsException after a big failed report.
    
- **ga4_run_funnel_report** — Run a GA4 funnel report. v1alpha, API surface may change.

    funnel: {
      is_open_funnel: bool,
      steps: [
        {
          name: str,
          is_directly_followed_by: bool,
          filter_expression: FunnelFilterExpression,
          within_duration_from_prior_step: {seconds: int},
        }, ...
      ]
    }
    funnel_breakdown: {dimension_name, limit}, optional per-step breakdown.
    funnel_next_action: {dimension_name, limit}, optional "what came after".

    Use for drop-off analysis across a sequence of events. Behind an alpha flag
    because Google can change the shape, check the Feb 2026 release notes if
    this fails with a validation error.

    Ref: https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties/runFunnelReport
    

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

```json
"mcpServers": {
  "google-analytics-4-mcp": {
    "command": "uvx",
    "args": ["scalably-ga4-mcp"],
    "env": {
      "GOOGLE_APPLICATION_CREDENTIALS": "",
      "GA4_LOG_LEVEL": ""
    }
  }
}
```

**Requires environment variables:** `GOOGLE_APPLICATION_CREDENTIALS`, `GA4_LOG_LEVEL` — 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 MCP server does

Google Analytics 4 MCP MCP server gives MCP clients read-only access to Google Analytics 4 through the Google Analytics Data API and Admin API. It can discover accounts and properties, inspect property configuration, query historical reports, retrieve realtime data, analyze funnels, and examine the dimensions and metrics available to a property.

The server does not modify GA4 configuration or data. Authentication uses a Google Cloud service account with the `analytics.readonly` scope. The service account can read properties where its email has been granted Viewer access.

## How it works

Start by calling `ga4_list_account_summaries` to find the GA4 properties visible to the service account. Pass a discovered `property_id` to reporting and administration tools. Standard reports support dimension and metric filters, including nested boolean filter groups. The server also accepts batch requests containing up to five reports in one call.

Responses use a consistent JSON structure with status, operation, summary, target, result, proof, warnings, and recovery fields. A partial response can include `proof.nextOffset`, which indicates that the caller should continue from the returned offset. `proof.propertyQuota` reports remaining Data API quota, while `proof.dataQualityLimited` identifies results affected by sampling, thresholding, or high-cardinality row collapse into `(other)`.

The Google Analytics 4 MCP MCP server runs locally and communicates with the Google APIs it wraps.

## Setup and configuration

Create or select a Google Cloud project and enable both the Google Analytics Data API and Google Analytics Admin API. Create a service account, download its JSON key, and add the account email as a Viewer under each target property's access management settings.

Set `GOOGLE_APPLICATION_CREDENTIALS` to the JSON key path. No OAuth consent screen or per-client property configuration is required. The optional `GA4_LOG_LEVEL` variable accepts `INFO` by default or `DEBUG` for more detailed logging.

Claude Code can register the server with `claude mcp add`, and Codex can use `codex mcp add`, both with `uvx scalably-ga4-mcp`. Claude Desktop can use the `ga4-mcp.mcpb` file from a GitHub release.

## Tools and capabilities

The 17 tools cover these areas:

- Account and property discovery, property details, and data streams for web, iOS, and Android.
- Custom dimensions, custom metrics, key events, audiences, Google Ads links, and reporting annotations.
- Access reports covering who read what on a property during the previous 12 months.
- Standard, batch, pivot, realtime, and funnel reports.
- The GA4 dimension and metric metadata catalog plus dimension-and-metric compatibility checks.

`ga4_run_realtime_report` covers the last 30 minutes and uses a separate, smaller catalog. `ga4_run_funnel_report` supports up to 10 steps and uses the v1alpha API. The Google Analytics 4 MCP MCP server caps Data API responses at 250,000 rows.

## Limitations and notes

Historical GA4 data commonly lags by 24 to 48 hours, while realtime reports cover only the recent 30-minute window. Results can be sampled, thresholded, or grouped into `(other)`, so flagged responses should be treated as directional rather than exact.

Each quota bucket—core reports, realtime, and funnel—allows roughly 14,000 quota tokens per project and property per hour, although complex queries can consume more than one token. GA4 360 properties have a stated 10x multiplier. Quotas can vary, so verify Google's current quota documentation before depending on an exact value.

Funnel reporting is marked v1alpha and its response shape may change upstream. Batch calls are limited to five reports, funnel requests to ten steps, and client-supplied row limits above 250,000 are capped by the server. The server is licensed under MIT.

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

