Skip to main content

Announcing StackOne Defender: leading open-source prompt injection guard for your agent Read More

Google Analytics MCP Server
for AI Agents

Production-ready Google Analytics MCP server with 32 extensible actions — plus built-in authentication, security, and optimized execution.

Google Analytics logo
Google Analytics MCP Server
Built by StackOne StackOne

Coverage

32 Agent Actions

Create, read, update, and delete across Google Analytics — and extend your agent's capabilities with custom actions.

Authentication

Agent Tool Authentication

Per-user OAuth in one call. Your Google Analytics MCP server gets session-scoped tokens with zero credentials stored on your infra.

Agent Auth →

Security

Agent Protection

Every Google Analytics tool response scanned for prompt injection in milliseconds — 88.7% accuracy, all running on CPU.

Prompt Injection Defense →

Performance

Max Agent Context. Min Cost.

Free up to 96% of your agent's context window to enhance reasoning and reduce cost, on every Google Analytics call.

Tools Discovery →

What is the Google Analytics MCP Server?

A Google Analytics MCP server lets AI agents read and write Google Analytics data through the Model Context Protocol — Anthropic's open standard for connecting LLMs to external tools. StackOne's Google Analytics MCP server ships with 32 pre-built actions, fully extensible via the Connector Builder — plus managed authentication, prompt injection defense, and optimized agent context. Connect it from MCP clients like Claude Desktop, Cursor, and VS Code, or from agent frameworks like OpenAI Agents SDK, LangChain, and Vercel AI SDK.

All Google Analytics MCP Tools and Actions

Every action from Google Analytics's API, ready for your agent. Create, read, update, and delete — scoped to exactly what you need.

Accounts

  • List Accounts

    List all Google Analytics accounts accessible to the authenticated user

  • Get Account

    Get details of a specific Google Analytics account by its resource name

Propertys

  • Create Property

    Create a new Google Analytics 4 property under an account

  • Get Property

    Get details of a specific Google Analytics 4 property by its resource name

  • Update Property

    Update settings of an existing Google Analytics 4 property

Run Reports

  • Batch Run Reports

    Run multiple Google Analytics reports in a single API call

  • Run Report

    Run a customized report on Google Analytics 4 data for a property

Data Streams

  • Create Data Stream

    Create a new data stream for a Google Analytics 4 property

  • List Data Streams

    List all data streams for a Google Analytics 4 property

  • Get Data Stream

    Get details of a specific data stream by its full resource name

  • Delete Data Stream

    Delete a data stream from a Google Analytics 4 property

Measurement Protocol Secrets

  • Create Measurement Protocol Secret

    Create a Measurement Protocol secret for a Google Analytics 4 data stream

  • List Measurement Protocol Secrets

    List all Measurement Protocol secrets for a Google Analytics 4 data stream

  • Get Measurement Protocol Secret

    Get details of a specific Measurement Protocol secret by its full resource name

  • Delete Measurement Protocol Secret

    Delete a Measurement Protocol secret from a Google Analytics 4 data stream

Audience Exports

  • Create Audience Export

    Create an audience export for a Google Analytics 4 property

  • List Audience Exports

    List all audience exports for a Google Analytics 4 property

  • Get Audience Export

    Get details of a specific audience export by its full resource name

  • Query Audience Export

    Query user data from an ACTIVE audience export

Key Events

  • Create Key Event

    Create a new key event for a Google Analytics 4 property

  • List Key Events

    List all key events for a Google Analytics 4 property

  • Get Key Event

    Get details of a specific key event by its full resource name

  • Delete Key Event

    Delete a key event from a Google Analytics 4 property

Other (9)

  • List Account Summaries

    List summaries of all accounts and their properties accessible to the authenticated user

  • Get Data Sharing Settings

    Get data sharing settings for a Google Analytics account

  • List Properties

    List all Google Analytics 4 properties under an account

  • Get Data Retention Settings

    Get data retention settings for a Google Analytics 4 property

  • Get Metadata

    Get metadata about dimensions and metrics available for a GA4 property

  • Acknowledge User Data Collection

    Acknowledge user data collection terms for a Google Analytics 4 property

  • Run Realtime Report

    Run a realtime report on active users currently on a GA4 property

  • Run Pivot Report

    Run a pivot report to summarize Google Analytics data with cross-tabulated dimensions

  • Patch Key Event

    Update a key event's counting method or default value

Set Up Your Google Analytics MCP Server in Minutes

One endpoint. Any framework. Your agent is talking to Google Analytics in under 10 lines of code.

MCP Clients

Agent Frameworks

Claude Desktop
{
  "mcpServers": {
    "stackone": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@latest",
        "https://api.stackone.com/mcp?x-account-id=<account_id>",
        "--header",
        "Authorization: Basic <YOUR_BASE64_TOKEN>"
      ]
    }
  }
}

More Data & Analytics MCP Servers

Tableau

114+ actions

SurveyMonkey

104+ actions

Microsoft Excel

101+ actions

Qlik

100+ actions

Snowflake

80+ actions

PostHog

63+ actions

Amplitude

53+ actions

Google Analytics MCP Server FAQ

Google Analytics MCP server vs direct API integration — what's the difference?
A Google Analytics MCP server and direct API integration serve different use cases. Direct API integration is for software-to-software — backend code calling Google Analytics. A Google Analytics MCP server is for AI agents — MCP clients like Claude and Cursor, plus framework agents built with OpenAI, LangChain, or Vercel AI — discovering and calling Google Analytics at runtime. StackOne provides both.
How does Google Analytics authentication work for AI agents?
Google Analytics authentication for AI agents works through a StackOne Connect Session. Create one via the dashboard or the SDK — you get an auth link and ready-to-paste config for Claude Desktop, Cursor, and other MCP clients. Your user authenticates their own Google Analytics account; StackOne handles token exchange, storage, and refresh. Credentials never reach the LLM, and each user is isolated via origin_owner_id.
Are Google Analytics MCP tools vulnerable to prompt injection?
Yes — Google Analytics MCP tools can be vulnerable to indirect prompt injection. Any tool that reads user-written content — documents, messages, tickets, records, or free-text fields — is a potential vector. StackOne Defender scans every tool response before it enters the agent's context — regex patterns in ~1ms, then a MiniLM classifier in ~4ms. 88.7% accuracy, CPU-only.
What is the context bloat of a Google Analytics agent and how do I avoid it?
Context bloat happens when Google Analytics tool schemas and API responses eat your Google Analytics agent's memory, preventing it from reasoning effectively. A single Google Analytics query can return a massive JSON response, and connecting multiple tools compounds the problem. Tools Discovery and Code Mode reduce context bloat — loading only relevant tools per query and keeping raw responses out of the agent's context.
Can I limit which actions my Google Analytics agent can access?
Yes — you can limit which actions your Google Analytics agent can access directly from the StackOne dashboard. Toggle actions on or off, or restrict them to specific accounts, with no code changes to your agent. Session tokens can be scoped to exact actions so if one leaks, exposure stays contained.
Can I create custom agent actions for my Google Analytics MCP server?
Yes — you can create custom agent actions for your Google Analytics MCP server using Connector Builder. It's an integration agent your coding assistant (Claude Code, Cursor, or Copilot) can invoke to research Google Analytics's API, generate production-ready connector YAML, test against the live API, and validate before you ship.
When should I NOT use a Google Analytics MCP server?
Skip a Google Analytics MCP server if your integration is purely software-to-software — direct Google Analytics API integration is simpler when no AI agent is involved. For deterministic, compliance-critical operations (financial transactions, regulatory reporting), direct API gives you predictable behavior without agent-driven decision-making. MCP shines when AI agents need to dynamically discover and call Google Analytics actions at runtime.
What AI frameworks and AI clients does the StackOne Google Analytics MCP server support?
The StackOne Google Analytics MCP server supports both. MCP clients (paste-and-go apps): Claude Desktop, Claude Code, Cursor, VS Code, Goose. Agent frameworks (code SDKs you build with): OpenAI Agents SDK, Anthropic, Vercel AI, Google ADK, CrewAI, Pydantic AI, LangChain, LangGraph, Azure AI Foundry.

Put your AI agents to work

All the tools you need to build and scale AI agent integrations, with best-in-class connectivity, execution, and security.