Connect your AI Agents to Google Analytics in minutes

Merge lets you securely connect your agents to Google Analytics and thousands of tools instantly

Available tools

list_accounts

List all Google Analytics accounts you have access to. Use this to discover account IDs before listing properties. Returns paginated results.

get_account

Get details of a specific Google Analytics account by ID. Returns account display name, creation time, and update time.

update_account

Update a Google Analytics account's display name. Provide the account ID and new display name.

list_audiences

List audiences for a property. Audiences let you segment users based on shared characteristics or behaviors.

get_audience

Get details of a specific audience. Returns display name, description, and membership duration.

create_audience

Create a new audience for a property. Specify display name and optionally description and membership duration.

update_audience

Update an audience's display name or description. Provide audience ID and fields to update.

list_custom_dimensions

List custom dimensions for a property. Custom dimensions let you collect and analyze data on custom user attributes.

get_custom_dimension

Get details of a specific custom dimension. Returns parameter name, scope, and display name.

create_custom_dimension

Create a new custom dimension for a property. Specify parameter name, display name, and scope (EVENT, USER, or ITEM).

update_custom_dimension

Update a custom dimension's display name or description. Provide dimension ID and fields to update.

list_custom_metrics

List custom metrics for a property. Custom metrics let you collect and aggregate numeric data on user interactions.

get_custom_metric

Get details of a specific custom metric. Returns parameter name, scope, and measurement unit.

create_custom_metric

Create a new custom metric for a property. Specify parameter name, display name, scope, and measurement unit.

update_custom_metric

Update a custom metric's display name or description. Provide metric ID and fields to update.

list_data_streams

List data streams (websites or mobile apps) for a property. Data streams are the sources of data for your property.

get_data_stream

Get details of a specific data stream. Returns stream type, creation time, and platform-specific configuration.

create_data_stream

Create a new data stream (website or mobile app) for a property. Specify stream type and platform-specific configuration.

list_key_events

List key events (conversions) for a property. Key events are important actions you want to track and measure.

get_key_event

Get details of a specific key event. Returns event name, creation time, and whether it can be deleted.

create_key_event

Create a new key event (conversion) for a property. Specify the event name to track as a conversion.

delete_key_event

Delete a key event (conversion) from a property. Use get_key_event to check if a key event is deletable before attempting deletion.

list_properties

List Google Analytics properties under an account. Properties contain data from websites or apps. Use list_accounts first to discover account IDs.

get_property

Get details of a specific Google Analytics property. Returns display name, timezone, currency, industry category, and creation time.

create_property

Create a new Google Analytics property in an account. Requires account ID, display name, timezone, and currency code.

update_property

Update a Google Analytics property's settings (display name, timezone, currency code). Provide property ID and fields to update.

run_report

Generate a custom Google Analytics report with dimensions, metrics, and filters. Call get_metadata first to discover available dimensions/metrics. Returns rows of data with pagination support.

batch_run_reports

Run multiple reports in a single API call. More efficient than calling run_report multiple times. Each request is independent.

run_realtime_report

Get real-time event data (30-60 minute window) for a property. Limited dimensions and metrics available compared to standard reports. Useful for monitoring live site activity.

get_metadata

Get all available dimensions and metrics for a property. Returns complete list with descriptions, data types, and deprecation status. Call this before run_report to see what's available.

check_compatibility

Validate that dimensions and metrics are compatible for reporting. Useful before constructing a complex report to ensure the combination is valid and will return data.

validate_credential

Validate Google Analytics OAuth2 credentials by listing accounts. Returns success if token is valid and has required scopes.

View all tools by creating a free accountSee more tools

How to set up Merge Agent Handler

In an mcp.json file, add the configuration below, and restart Cursor.

Learn more in the official documentation ↗

1{
2  "mcpServers": {
3    "agent-handler": {
4      "url": "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
5      "headers": {
6        "Authorization": "Bearer yMt*****"
7      }
8    }
9  }
10}
11
Copy Code

Open your Claude Desktop configuration file and add the server configuration below. You'll also need to restart the application for the changes to take effect.

Make sure Claude is using the Node v20+.

Learn more in the official documentation ↗

1{
2  "mcpServers": {
3    "agent-handler": {
4      "command": "npx",
5      "args": [
6        "-y",
7        "mcp-remote@latest",
8        "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
9        "--header",
10        "Authorization: Bearer ${AUTH_TOKEN}"
11      ],
12      "env": {
13        "AUTH_TOKEN": "yMt*****"
14      }
15    }
16  }
17}
Copy Code
Copied!

Open your Windsurf MCP configuration file and add the server configuration below.
Click on the refresh button in the top right of the Manage MCP server page or in the top right of the chat box in the box icon.

Learn more in the official documentation ↗

1{
2    "mcpServers": {
3      "agent-handler": {
4        "command": "npx",
5        "args": [
6          "-y",
7          "mcp-remote@latest",
8          "https://ah-api.merge.dev/api/v1/tool-packs/<tool-pack-id>/registered-users/<registered-user-id>/mcp",
9          "--header",
10          "Authorization: Bearer ${AUTH_TOKEN}"
11        ],
12        "env": {
13          "AUTH_TOKEN": "<ah-production-access-key>"
14        }
15      }
16    }
17  }
Copy Code

In Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows), run "MCP: Open User Configuration".

You can then add the configuration below and press "start" right under servers. Enter the auth token when prompted.

Learn more in the official documentation ↗

1{
2  "inputs": [
3    {
4      "type": "promptString",
5      "id": "agent-handler-auth",
6      "description": "Agent Handler AUTH_TOKEN", // "yMt*****" when prompt
7      "password": true
8    }
9  ],
10  "servers": {
11    "agent-handler": {
12      "type": "stdio",
13      "command": "npx",
14      "args": [
15        "-y",
16        "mcp-remote@latest",
17        "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
18        "--header",
19        "Authorization: Bearer ${input:agent-handler-auth}"
20      ]
21    }
22  }
23}
Copy Code

FAQs on using Merge's Google Analytics  MCP server

FAQs on using Merge's Google Analytics  MCP server

What is a Google Analytics MCP?

It's an MCP server that lets your agents access data and functionality from Google Analytics via tools. Your agents can invoke these tools to run custom reports, pull real-time traffic data, list audiences, check conversion events, and more.

Google Analytics offers an official MCP server, but you can also use one from a third-party platform, like Merge Agent Handler.

How can I use the Google Analytics MCP server?

The use cases naturally depend on the agent you've built, but here are a few common ones:

  • Traffic anomaly detection: an agent monitors real-time and daily traffic reports and flags sudden spikes or drops against baseline, then posts an alert to Slack so the team can investigate before a launch or outage goes unnoticed
  • Marketing performance reporting: an agent pulls channel-level traffic and conversion data on a schedule and compiles a weekly summary for stakeholders, without anyone opening the GA4 interface
  • Conversion funnel analysis: an agent runs a funnel report across a signup or checkout flow, identifies the step with the highest drop-off, and surfaces it in a ticket for the product team to investigate
  • Cross-tool spend correlation: an agent combines Google Analytics conversion data with ad spend from a connected ad platform or pipeline data from a CRM to calculate blended cost per acquisition by campaign

What are popular tools for Google Analytics's MCP server?

Here are some of the most commonly used tools:

  • run_report: runs a custom Google Analytics report across dimensions and metrics you specify, like sessions by channel or revenue by landing page. Useful for agents that need to answer a specific analytics question on demand
  • run_realtime_report: pulls active user and event data from the last 30 to 60 minutes. Call this when an agent needs to detect a traffic spike or confirm a launch is tracking correctly
  • list_audiences: returns the audiences configured on a property, along with their membership rules. Good for workflows that need to check segmentation before targeting or reporting on a specific group
  • create_key_event: marks an existing event as a key event (conversion) so it shows up in conversion reporting. Helpful when an agent needs to register a new conversion goal without going into the GA4 admin panel
  • create_custom_dimension: defines a new custom dimension on a property so it can be used in future reports. Use this when an agent needs to track a new attribute, like subscription tier or content author, that GA4 doesn't capture by default
  • list_properties: lists the Google Analytics properties available to the authenticated account. Useful for agents that manage reporting across multiple sites or apps and need to confirm which property to query first

What makes Merge Agent Handler's Google Analytics MCP server better than alternative Google Analytics MCP servers?

There are several reasons to use Merge Agent Handler's Google Analytics MCP server over building or using an alternative:

  • Enterprise-grade security and DLP: Merge Agent Handler includes built-in data loss prevention controls that let you block or redact sensitive fields before they reach an agent. For Google Analytics, this means you can prevent user-level traffic data or audience segments from being exposed even when the agent has broad read access
  • Managed authentication and credentials: Merge stores and refreshes Google Analytics credentials on your behalf. You never expose raw API keys or OAuth tokens to an agent or manage token rotation manually
  • Real-time observability and audit trail: every tool call made against Google Analytics is logged with timestamp, tool name, input parameters, and response metadata. You can audit exactly what an agent read or wrote without instrumenting anything yourself
  • Tool Packs and controlled access: Tool Packs let you bundle specific Google Analytics tools with tools from other connectors into a single MCP endpoint, scoped to a specific use case. An agent gets exactly the tools it needs, nothing more

How can I start using Merge Agent Handler's Google Analytics MCP server?

You can take the following steps:

1. Create or log into your Merge Agent Handler account.

2. Install the Merge CLI by running pipx install merge-api, then run merge configure to link the CLI to your Merge account and merge login to authenticate your session.

3. Register the Agent Handler MCP server with Claude Code by running claude mcp add --transport http agent-handler https://ah-api.merge.dev/mcp, then open Claude Code and run /mcp to confirm agent-handler appears with a connected status.

4. Select agent-handler from the MCP list. This opens a browser window where you select which integrations to authenticate. Choose Google Analytics and complete the auth flow. Merge stores and manages the credentials going forward.

5. Open a Claude Code session and start querying Google Analytics data directly. The first time you use a Google Analytics tool, a Magic Link may appear to complete connector authentication.

If you want to connect Merge Agent Handler's Google Analytics MCP with internal or customer-facing agentic products, you can follow the steps in our docs.

Can employees use Merge Agent Handler to connect their AI tools to Google Analytics?

Yes, Agent Handler for Employees lets your employees connect Claude, ChatGPT, Microsoft Copilot, Cursor, and other MCP-compatible AI tools to Google Analytics without bypassing IT governance.

IT provisions access by role or group via SCIM. A marketing analyst, for example, gets Google Analytics access to pull weekly traffic reports, HubSpot to review campaign performance, and Slack to share findings with the team; while a growth engineer gets Google Analytics access to monitor conversion events, Google Ads to adjust bidding strategy, and Jira to track experiment tickets.

Every tool call an employee's AI makes to Google Analytics is also inspected against your DLP rules and logged to a searchable audit trail, giving security teams full visibility into what data was accessed and by whom.

Explore other MCP servers built and managed by Merge

onedrive_gcc
OneDrive GCC High
onenote
OneNote
oracle_hcm
Oracle HCM
oracle_sales_cloud
Oracle Sales Cloud
oracle_scm
Oracle SCM
oura
Oura
outlook
Outlook
pagerduty
PagerDuty
paypal
PayPal
peec
Peec AI
pendo
Pendo
pipedrive
Pipedrive
plaud
Plaud
podium
Podium
posthog
PostHog
pubmed
PubMed
pylon
Pylon
quartr
Quartr
quickbooks_online
QuickBooks Online
ramp
Ramp
readme
ReadMe
render
Render
rootly
Rootly
sabre
Sabre

Ready to try it out?

Whether you're an engineer experimenting with agents or a product manager looking to add tools, you can get started for free now