# GA4 MCP Server > Model Context Protocol server for Google Analytics 4. Read-only reporting, schema discovery, and 17 analytical skills that load on demand. MIT, local stdio, v2.11.9. Docs: https://ga4mcp.com Repo: https://github.com/surendranb/google-analytics-mcp Not affiliated with Google. ## Install - `curl -fsSL https://ga4.builditwithai.xyz/install | bash` - `uvx google-analytics-mcp` - `npx -y @surendranb/google-analytics-mcp` Requires `GA4_PROPERTY_ID` and `GOOGLE_APPLICATION_CREDENTIALS`. ## Tools (12) - `check_for_updates`: Check PyPI for newer versions of this MCP server and get upgrade instructions. - `list_properties`: List all GA4 properties associated with an account. - `search_schema`: Search for a keyword across all dimensions and metrics for this property. - `get_property_schema`: Returns the complete schema for the configured GA4 property, including all available dimensions and metrics (standard and custom). - `list_dimension_categories`: List all dimension categories for this GA4 property, with a count of dimensions in each category. - `list_metric_categories`: List all metric categories for this GA4 property, with a count of metrics in each category. - `get_dimensions_by_category`: Return all dimensions in a specific category with their API names and descriptions. - `get_metrics_by_category`: Return all metrics in a specific category with their API names and descriptions. - `get_ga4_data`: Retrieve GA4 data with built-in intelligence for better and safer results. - `get_troubleshooting_guide`: Returns the troubleshooting/setup guide for a topic, served from inside the server (no network needed). - `search_skills`: Fetch analytical recipes and how-to guides from the GA4 skills library. - `setup_ga4_access`: Interactively fix a broken GA4 MCP setup (missing property ID, missing or expired credentials, or missing GA4 access) by asking the user for the needed input through... ## Skills (17) - [Track AI Referral Traffic in Google Analytics 4](https://ga4mcp.com/skills/ai-referral-analysis/) ([markdown](https://ga4mcp.com/skills/ai-referral-analysis/index.md)): How to track and measure traffic from ChatGPT, Claude, Perplexity, and Gemini in GA4. Exact dimension filters, regex patterns, and channel comparison rules. - [GA4 Attribution Scope: User vs. Session vs. Event](https://ga4mcp.com/skills/attribution-scope/) ([markdown](https://ga4mcp.com/skills/attribution-scope/index.md)): Why session, user, and event metrics never match in GA4. Rules for pairing dimensions and metrics across user-scoped, session-scoped, and event-scoped models. - [Identify & Filter Bot Traffic in Google Analytics 4](https://ga4mcp.com/skills/bot-traffic-detection/) ([markdown](https://ga4mcp.com/skills/bot-traffic-detection/index.md)): Detect and filter automated bot spikes in Google Analytics 4. Patterns for datacenter ASN spikes, zero-second sessions, and single-page screenPageViews. - [GA4 Channel Acquisition: Default Grouping Rules](https://ga4mcp.com/skills/channel-acquisition/) ([markdown](https://ga4mcp.com/skills/channel-acquisition/index.md)): How GA4 Default Channel Groups work, how to audit channel performance, and how to spot traffic falling into Unassigned or Direct due to broken UTM parameters. - [GA4 Dimensions and Metrics Reference: API Field Names](https://ga4mcp.com/skills/common-metric-names/) ([markdown](https://ga4mcp.com/skills/common-metric-names/index.md)): Exact API field names for GA4 Data API queries. Avoid 400 errors from Universal Analytics names like ga:sessions or pageviews by using valid GA4 schema. - [Compatible Dimension & Metric Combinations in GA4](https://ga4mcp.com/skills/compatible-combinations/) ([markdown](https://ga4mcp.com/skills/compatible-combinations/index.md)): Which dimensions and metrics can be queried together in GA4 without triggering incompatible scope errors. Matrix of user, session, and event-level pairings. - [GA4 Content Performance: Views & Engagement Rates](https://ga4mcp.com/skills/content-performance/) ([markdown](https://ga4mcp.com/skills/content-performance/index.md)): Evaluate landing pages and blog content in GA4: screenPageViews, average engagement time, bounce rates, and organic search conversions per URL. - [GA4 Custom Dimensions & Event Parameters Guide](https://ga4mcp.com/skills/custom-dimensions/) ([markdown](https://ga4mcp.com/skills/custom-dimensions/index.md)): Query custom dimensions and event parameters in the GA4 Data API. How to find parameter names, register them in GA4 Admin, and query custom event schemas. - [GA4 API Date Ranges: Syntax, Offsets & Comparisons](https://ga4mcp.com/skills/date-ranges/) ([markdown](https://ga4mcp.com/skills/date-ranges/index.md)): Allowed date string formats for the GA4 Data API: YYYY-MM-DD, today, yesterday, 7daysAgo, 30daysAgo, and multi-range period comparisons without API errors. - [GA4 Ecommerce Analysis: Revenue, AOV & Funnel Drop-off](https://ga4mcp.com/skills/ecommerce-analysis/) ([markdown](https://ga4mcp.com/skills/ecommerce-analysis/index.md)): Analyze GA4 ecommerce performance: purchase revenue, average order value, checkout funnel drop-off, and item revenue by acquisition channel. - [GA4 API Filter Expressions & Dimension Regex Syntax](https://ga4mcp.com/skills/filter-structures/) ([markdown](https://ga4mcp.com/skills/filter-structures/index.md)): Copy-paste filter templates for the GA4 Data API: exact match, beginsWith, contains, regex, AND/OR group expressions, and inListFilter structures. - [GA4 API Limitations, Quotas & Cardinality Boundaries](https://ga4mcp.com/skills/ga4-limitations/) ([markdown](https://ga4mcp.com/skills/ga4-limitations/index.md)): GA4 Data API boundaries: 10-dimension limit, 100,000 row caps, hourly token quotas, and sampling thresholds. How to query safely within API limits. - [GCP Service Account Setup for GA4 Data API](https://ga4mcp.com/skills/gcp-setup/) ([markdown](https://ga4mcp.com/skills/gcp-setup/index.md)): Step-by-step GCP service account provisioning for the GA4 Data API. Create JSON keys, assign the Viewer role in GA4 Admin, and avoid common 403 errors. - [Geo and Device Segmentation](https://ga4mcp.com/skills/geo-device-segmentation/) ([markdown](https://ga4mcp.com/skills/geo-device-segmentation/index.md)): Segment GA4 data by country, city, device category, and browser. Spot localization opportunities and mobile conversion drops with ready queries. - [GA4 Service Account Setup Guide](https://ga4mcp.com/skills/service-account-setup/) ([markdown](https://ga4mcp.com/skills/service-account-setup/index.md)): Step-by-step GA4 service account setup. Generate Google Cloud JSON keys, enable the Data API, and grant Viewer permissions in Google Analytics Admin. - [Diagnose GA4 Traffic Drops: Step-by-Step Triage](https://ga4mcp.com/skills/traffic-diagnosis/) ([markdown](https://ga4mcp.com/skills/traffic-diagnosis/index.md)): A six-step triage framework to diagnose GA4 traffic drops. Isolate channel shifts, check tracking snippet errors, and distinguish real drops from bot drops. - [Universal Analytics to GA4 Field Name Mapping](https://ga4mcp.com/skills/ua-to-ga4/) ([markdown](https://ga4mcp.com/skills/ua-to-ga4/index.md)): Mapping table from Universal Analytics (UA) field names to Google Analytics 4 (GA4) Data API names. Replace ga:pageviews, ga:bounces, and ga:users correctly. ## Pages - [GA4 MCP client setup — the config each one expects](https://ga4mcp.com/ga4-mcp-for-every-harness/) ([markdown](https://ga4mcp.com/ga4-mcp-for-every-harness/index.md)) - [Connect Antigravity IDE to GA4 (Setup & Queries)](https://ga4mcp.com/ga4-mcp-for-antigravity-ide/) ([markdown](https://ga4mcp.com/ga4-mcp-for-antigravity-ide/index.md)) - [Connect Google Antigravity to GA4 (App, IDE & CLI)](https://ga4mcp.com/ga4-mcp-for-antigravity/) ([markdown](https://ga4mcp.com/ga4-mcp-for-antigravity/index.md)) - [Connect Claude to Google Analytics 4 (Code & Desktop)](https://ga4mcp.com/ga4-mcp-for-claude/) ([markdown](https://ga4mcp.com/ga4-mcp-for-claude/index.md)) - [Connect OpenAI Codex to Google Analytics 4 (Data API)](https://ga4mcp.com/ga4-mcp-for-codex/) ([markdown](https://ga4mcp.com/ga4-mcp-for-codex/index.md)) - [Connect Cursor to Google Analytics 4 (Setup & Queries)](https://ga4mcp.com/ga4-mcp-for-cursor/) ([markdown](https://ga4mcp.com/ga4-mcp-for-cursor/index.md)) - [Connect DeepSeek Harness to GA4 (Data API Setup)](https://ga4mcp.com/ga4-mcp-for-deepseek/) ([markdown](https://ga4mcp.com/ga4-mcp-for-deepseek/index.md)) - [Connect Devin Desktop (Windsurf) to GA4 MCP](https://ga4mcp.com/ga4-mcp-for-devin-desktop/) ([markdown](https://ga4mcp.com/ga4-mcp-for-devin-desktop/index.md)) - [Connect Gemini CLI to Google Analytics 4 (Data API)](https://ga4mcp.com/ga4-mcp-for-gemini/) ([markdown](https://ga4mcp.com/ga4-mcp-for-gemini/index.md)) - [Connect Goose CLI to Google Analytics 4 (MCP Setup)](https://ga4mcp.com/ga4-mcp-for-goose/) ([markdown](https://ga4mcp.com/ga4-mcp-for-goose/index.md)) - [Connect Hermes Agent to Google Analytics 4 (MCP Setup)](https://ga4mcp.com/ga4-mcp-for-hermes/) ([markdown](https://ga4mcp.com/ga4-mcp-for-hermes/index.md)) - [Connect Kiro IDE to Google Analytics 4 (MCP Setup)](https://ga4mcp.com/ga4-mcp-for-kiro/) ([markdown](https://ga4mcp.com/ga4-mcp-for-kiro/index.md)) - [Connect OpenClaw to Google Analytics 4 (MCP Setup)](https://ga4mcp.com/ga4-mcp-for-openclaw/) ([markdown](https://ga4mcp.com/ga4-mcp-for-openclaw/index.md)) - [Connect OpenCode to Google Analytics 4 (Local stdio)](https://ga4mcp.com/ga4-mcp-for-opencode/) ([markdown](https://ga4mcp.com/ga4-mcp-for-opencode/index.md)) - [Connect Pi Agent to Google Analytics 4 (MCP Setup)](https://ga4mcp.com/ga4-mcp-for-pi/) ([markdown](https://ga4mcp.com/ga4-mcp-for-pi/index.md)) - [Connect VS Code & Copilot to Google Analytics 4](https://ga4mcp.com/ga4-mcp-for-vscode/) ([markdown](https://ga4mcp.com/ga4-mcp-for-vscode/index.md)) - [Connect ZCode Harness to Google Analytics 4 (MCP)](https://ga4mcp.com/ga4-mcp-for-zcode/) ([markdown](https://ga4mcp.com/ga4-mcp-for-zcode/index.md)) - [Connect Zed Editor to Google Analytics 4 (Setup Guide)](https://ga4mcp.com/ga4-mcp-for-zed/) ([markdown](https://ga4mcp.com/ga4-mcp-for-zed/index.md)) - [GA4 plugin for Claude Code](https://ga4mcp.com/ga4-plugin-for-claude-code/) ([markdown](https://ga4mcp.com/ga4-plugin-for-claude-code/index.md)) - [GA4 extension for Gemini CLI](https://ga4mcp.com/ga4-plugin-for-gemini/) ([markdown](https://ga4mcp.com/ga4-plugin-for-gemini/index.md)) - [35 Production GA4 Prompts for Claude, Cursor & AI](https://ga4mcp.com/google-analytics-ai-prompts/) ([markdown](https://ga4mcp.com/google-analytics-ai-prompts/index.md)) - [GA4 403 Permission Denied: Service Account Viewer Fix](https://ga4mcp.com/iam/) ([markdown](https://ga4mcp.com/iam/index.md)) - [GA4 MCP — Connect Google Analytics 4 to Claude & AI](https://ga4mcp.com/) ([markdown](https://ga4mcp.com/index.md)) - [Natural Language Google Analytics: Query GA4 with AI](https://ga4mcp.com/natural-language-google-analytics/) ([markdown](https://ga4mcp.com/natural-language-google-analytics/index.md)) - [GA4 MCP plugins for Claude Code and Gemini CLI](https://ga4mcp.com/ga4-plugins/) ([markdown](https://ga4mcp.com/ga4-plugins/index.md)) - [Privacy — what the GA4 MCP server sends](https://ga4mcp.com/privacy/) ([markdown](https://ga4mcp.com/privacy/index.md)) - [GA4 Invalid Dimension or Metric: Fix the 400 Error](https://ga4mcp.com/schema/) ([markdown](https://ga4mcp.com/schema/index.md)) - [GA4 MCP Setup Error: GA4_PROPERTY_ID or Credentials](https://ga4mcp.com/setup/) ([markdown](https://ga4mcp.com/setup/index.md)) - [GA4 skills — sixteen analytical recipes for your agent](https://ga4mcp.com/skills/) ([markdown](https://ga4mcp.com/skills/index.md)) - [Terms of use](https://ga4mcp.com/terms/) ([markdown](https://ga4mcp.com/terms/index.md)) - [Fix Common GA4 Data API & IAM Errors (Quick Guide)](https://ga4mcp.com/troubleshooting/) ([markdown](https://ga4mcp.com/troubleshooting/index.md))