Google Analytics MCP server for AI agents and assistants

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Google Analytics MCP or direct API to generate reports, analyze user trends, monitor conversion funnels, and surface insights through natural language.

Google Analytics logoGoogle Analytics
Oauth2

Google Analytics tracks and reports website traffic, user behavior, and conversions. It helps marketers optimize performance and understand customer journeys.

67 Tools

Try Google Analytics now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Google Analytics
Try asking
TOOLS

Supported Tools

Every Google Analytics action and event your agent gets out of the box.

Archive Custom Dimension

Tool to archive a CustomDimension on a property.

Batch Run Pivot Reports

Tool to return multiple pivot reports in a batch for a GA4 property.

Batch Run Reports

Tool to return multiple analytics data reports in a batch.

Check Compatibility

Tool to list dimensions and metrics compatible with a GA4 report request.

Create Audience Export

Tool to create an audience export for Google Analytics.

Create Audience List

Tool to create an audience list for later retrieval by initiating a long-running asynchronous request.

Create Custom Dimension

Tool to create a CustomDimension for a Google Analytics property.

Create Custom Metric

Tool to create a custom metric in Google Analytics.

Create Expanded Data Set

Tool to create an expanded data set for a property.

Create Recurring Audience List

Tool to create a recurring audience list that automatically generates new audience lists daily based on the latest data.

Create Report Task

Tool to create a report task as a long-running asynchronous request for customized Google Analytics event data reports.

Create Rollup Property

Tool to create a roll-up property.

Get Account

Tool to retrieve a single Account by its resource name.

Get Attribution Settings

Tool to retrieve attribution configuration for a Google Analytics property.

Get Audience

Tool to retrieve a single Audience configuration from a Google Analytics property.

Get Audience Export

Tool to get configuration metadata about a specific audience export.

Get Audience List

Tool to get configuration metadata about a specific audience list.

Get Custom Dimension

Tool to retrieve a single CustomDimension by its resource name.

Get Data Retention Settings

Tool to retrieve data retention configuration for a Google Analytics property.

Get Data Sharing Settings

Tool to retrieve data sharing configuration for a Google Analytics account.

Get Google Signals Settings

Tool to retrieve Google Signals configuration settings for a GA4 property.

Get Key Event

Tool to retrieve a Key Event.

Get Metadata

Tool to get metadata for dimensions, metrics, and comparisons for a GA4 property.

Get Property

Tool to retrieve a single GA4 Property by its resource name.

Get Property Quotas Snapshot

Tool to retrieve all property quotas organized by category (corePropertyQuota, funnelPropertyQuota, realtimePropertyQuota) for a given GA4 property.

Get Recurring Audience List

Tool to get configuration metadata about a specific recurring audience list.

Get Report Task

Tool to get report metadata about a specific report task.

List Account Summaries

Tool to retrieve summaries of all Google Analytics accounts accessible by the caller.

List Accounts (v1beta)

Tool to list all Google Analytics accounts accessible by the caller using v1beta API.

List AdSense Links

Tool to list all AdSenseLinks on a property.

List Audience Exports

Tool to list all audience exports for a property.

List Audience Lists

Tool to list all audience lists for a specified property to help find and reuse existing lists.

List Audiences

Tool to list Audiences on a property.

List BigQuery Links

Tool to list BigQuery Links on a property.

List Calculated Metrics

List Calculated Metrics

List Channel Groups

Tool to list ChannelGroups on a property.

List Conversion Events

Tool to list conversion events on a property.

List Custom Dimensions

List Custom Dimensions

List Custom Metrics

Tool to list CustomMetrics on a property.

List DataStreams

Tool to list DataStreams on a property.

List Display & Video 360 Advertiser Links

Tool to list Display & Video 360 advertiser links on a property.

List DisplayVideo360 Advertiser Link Proposals

Tool to list DisplayVideo360AdvertiserLinkProposals on a property.

List Event Create Rules

Tool to list EventCreateRules configured on a web data stream.

List Expanded Data Sets

Tool to list ExpandedDataSets on a property.

List Firebase Links

Tool to list FirebaseLinks on a property.

List Google Ads Links

Tool to list GoogleAdsLinks on a property.

List Key Events

Tool to list Key Events.

List Measurement Protocol Secrets

Tool to list MeasurementProtocolSecrets under a data stream.

List Property

Tool to list GA4 properties based on filter criteria.

List Recurring Audience Lists

Tool to list all recurring audience lists for a GA4 property.

List Reporting Data Annotations

Tool to list all Reporting Data Annotations for a specific property.

List Report Tasks

Tool to list all report tasks for a Google Analytics property.

List Search Ads 360 Links

Tool to list all SearchAds360Links on a property.

List SKAdNetwork Conversion Value Schemas

Tool to list SKAdNetworkConversionValueSchema configurations for an iOS data stream.

List Subproperty Event Filters

Tool to list all subproperty event filters on a property.

List Subproperty Sync Configs

Tool to list SubpropertySyncConfig resources for managing subproperty synchronization configurations.

Provision Account Ticket

Tool to request a ticket for creating a Google Analytics account.

Query Audience Export

Tool to query a completed audience export.

Query Audience List

Tool to query an audience list.

Query Report Task

Tool to retrieve a report task's content.

Run Funnel Report

Tool to run a GA4 funnel report.

Run Pivot Report

Tool to run a customized pivot report of Google Analytics event data.

Run Realtime Report

Tool to run a customized realtime report of Google Analytics event data.

Run Report

Tool to run a customized GA4 data report.

Send Events

Tool to send event data to Google Analytics 4 using the Measurement Protocol.

Update Property

Tool to update an existing GA4 Property.

Validate Events

Tool to validate Measurement Protocol events before sending them to production.

SETUP GUIDE

Connect Google Analytics MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
Install the Composio SDK and Claude Agent SDK
2

Create Tool Router Session

typescript
import { Composio } from '@composio/core';

const composio = new Composio({ apiKey: 'your-api-key' });

console.log("Creating Tool Router session...");
const { mcp } = await composio.create('your-user-id');
console.log(`Tool Router session created: ${mcp.url}`);
Initialize the Composio client and create a Tool Router session
3

Connect to AI Agent

typescript
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText, stepCountIs } from 'ai';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: mcp.url,
    headers: { 'x-api-key': 'your-composio-api-key' }
  }
});

const tools = await client.tools();

const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  messages: [{ role: 'user', content: 'List all accounts I can access in Google Analytics' }],
  stopWhen: stepCountIs(5)
});

console.log(`Agent: ${text}`);
Use the MCP server with your AI agent
SETUP GUIDE

Connect Google Analytics API Tool with your Agent

1

Install Composio

typescript
npm install @composio/openai
Install the Composio SDK
2

Initialize Composio and Create Tool Router Session

typescript
import OpenAI from 'openai';
import { Composio } from '@composio/core';
import { OpenAIResponsesProvider } from '@composio/openai';

const composio = new Composio({
  provider: new OpenAIResponsesProvider(),
});
const openai = new OpenAI({});
const session = await composio.create('your-user-id');
Import and initialize Composio client, then create a Tool Router session
3

Execute Google analytics Tools via Tool Router with Your Agent

typescript
const tools = session.tools;
const response = await openai.responses.create({
  model: 'gpt-4.1',
  tools: tools,
  input: [{
    role: 'user',
    content: 'List all Google Analytics accounts I can access'
  }],
});
const result = await composio.provider.handleToolCalls(
  'your-user-id',
  response.output
);
console.log(result);
Get tools from Tool Router session and execute Google analytics actions with your Agent

Why Use Composio?

AI Native Google Analytics Integration

  • Supports both Google Analytics MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Google Analytics data

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Google Analytics access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Google Analytics
  • Scoped, least privilege access to Google Analytics resources
  • Full audit trail of agent actions to support review and compliance
FAQ

Frequently asked questions

No. Composio provides a managed OAuth app for Google Analytics, so you sign in with your normal Google Analytics account and approve access. If you later want the consent screen to show your own company name, you can add your own Google Analytics OAuth app in the Composio dashboard, and every connection after that uses it.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Yes. Composio is SOC 2 Type II compliant and is built to keep your Google Analytics connection and credentials secure. OAuth tokens and API keys are encrypted, and sensitive customer data is protected at rest and in transit.

Composio also undergoes independent security testing and continuously monitors its systems for security threats. You can review the latest reports and policies in the Composio Trust Center.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

When you connect a Google Analytics account through Composio, every action runs under that account, so anything the agent creates, sends, or changes shows up in Google Analytics as done by you. Keep an approval step in your prompt for actions with side effects, such as sending or deleting, and have the agent draft first.

Exactly the ones Google Analytics lists on its consent screen when you connect. Review that screen before approving. If you connect a work account, your Google Analytics administrator may need to approve the app first, and you can revoke the access inside Google Analytics whenever you want.

Yes. Composio supports multiple connected accounts for the same app, and that works in Claude, ChatGPT, or any other assistant you connect through Composio. Give each Google Analytics connection a name such as work or personal, and the assistant uses the one you mention in the request. Each account keeps its own credentials and nothing is merged.

Composio refreshes Google Analytics tokens automatically, so day to day you do nothing. If you revoke access inside Google Analytics, or Google Analytics invalidates the session, the connection shows as expired in Composio and the agent stops acting on that account until you reconnect it, which is a single sign-in.

Composio's free plan includes 100,000 tool calls per month with no credit card, and up to 20,000 of those can run through Composio-managed apps like Google Analytics. Personal Google Analytics use rarely gets near that. Paid plans add higher limits and team features, and Google Analytics's own pricing is unaffected.

Built-in connectors usually give one AI access to a limited set of apps. Many people use Composio because it lets their AI connect to more apps than it normally supports, or connect to multiple accounts for the same app (e.g. connect Claude to multiple Google Analytics accounts).

With Composio, you connect Google Analytics once and then use it across different AI assistants without setting it up separately in each one. Connect your apps to Composio once, then connect Composio to whichever AI you use, whether that's Claude, ChatGPT, Hermes, or your own custom assistant.

Start with Google Analytics.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Google Analytics tool your agent needs.Free to start.

Start building