All integrations

Google Analytics 4

Connect GA4 to Claude, ChatGPT or Cursor via MCP. Discover properties and run core, realtime, and pivot reports.

OAuth 7 tools

Overview

Query Google Analytics 4 property reports and discover accounts from AI clients. This GA4 MCP integration lets marketing and product agents pull traffic, engagement, and realtime metrics without exporting CSVs.

Common use cases

  • Traffic and engagement reports — ask Claude or ChatGPT for active users, sessions, or top pages last week.
  • Realtime checks — see who is on the site right now by country or page.
  • Property discovery — list GA4 accounts and property IDs the connected Google account can access.
  • Private gateway — combine GA4 with Search Console, Gmail, and other integrations in one agent workflow.

Prerequisites

  • A Google account with access to at least one GA4 property
  • A stackgate.ai account

Getting credentials

  1. Open Integrations → Google Analytics 4.
  2. Click Activate, then Connect with Google OAuth.
  3. Grant Analytics read access (analytics.readonly).

Using with AI clients

  • Dedicated endpoint: POST /mcp/ga4
  • Private gateway: ga4__* tools

Example prompts:

  • Which GA4 properties can I access?
  • How many active users did property 123456789 have in the last 7 days, by country?
  • What are the realtime active users right now?
  • Which dimensions are compatible with activeUsers and sessionDefaultChannelGroup?

Troubleshooting

  • Empty account list — verify the Google account has Viewer (or higher) access in Google Analytics Admin.
  • Permission denied / 403 — reconnect to refresh OAuth scopes, and confirm the property ID is correct.
  • Quota exceeded — Google enforces per-property token buckets; narrow the date range, reduce limit, or wait and retry.
  • Auth errors — reconnect GA4 from My Integrations to refresh tokens.

Available tools

  • list_account_summaries

    List Google Analytics accounts and child GA4 properties accessible to the connected Google account.

  • get_property

    Get details for a GA4 property (display name, timezone, currency, industry category).

  • get_metadata

    List available dimensions and metrics for a GA4 property (useful before building a report).

  • run_report

    Run a core Google Analytics 4 report for a property over a date range with metrics and optional dimensions.

  • run_realtime_report

    Run a realtime Google Analytics 4 report for activity in the last approximately 30 minutes.

  • check_compatibility

    Check which dimensions and metrics can be combined in a report for a GA4 property.

  • run_pivot_report

    Run a pivot (cross-tab) Google Analytics 4 report for a property over a date range.

MCP endpoint: https://stackgate.ai/mcp/ga4 (HTTP) or via the private gateway.

Related workflows

Multi-integration playbooks that use Google Analytics 4 to solve concrete business outcomes.