Skip to main content
Glama
leonardosepulvedat

MCP Google Analytics Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GA_API_SECRETNoYour Google Analytics API secret for Measurement Protocol. Required for sending events.
GA_PROPERTY_IDNoYour Google Analytics 4 property ID (numeric, e.g., '123456789'). Required for reading data.
GA_MEASUREMENT_IDNoYour Google Analytics Measurement ID (format: G-XXXXXXXXXX). Required for sending events via Measurement Protocol.
GA_SERVICE_ACCOUNT_JSONNoPath to service account JSON file or the JSON content directly. Required for reading data via Google Analytics Data API.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
ga_run_reportA

Run a custom Google Analytics report with dimensions and metrics.

⚠️ TOKEN OPTIMIZATION: Use 'limit' to control result size (default: 10). This tool can consume significant tokens with large datasets.

Common dimensions: date, city, country, deviceCategory, browser, pagePath, eventName Common metrics: activeUsers, sessions, screenPageViews, conversions, totalRevenue

ga_run_realtime_reportA

Get real-time Google Analytics data (last 30 minutes).

⚠️ TOKEN OPTIMIZATION: Use 'limit' to control result size (default: 10).

Common dimensions: city, country, deviceCategory, unifiedScreenName Common metrics: activeUsers, screenPageViews, conversions

ga_get_metadataA

Get available dimensions and metrics metadata for your GA4 property.

⚠️ TOKEN OPTIMIZATION: This returns ALL available dimensions and metrics. Response can be large (~500+ items). Use sparingly and cache results when possible.

ga_list_accountsA

List all Google Analytics accounts accessible to the service account.

Use this to find account IDs for listing properties.

ga_list_propertiesA

List Google Analytics properties.

Optionally filter by account ID. Without an account ID, properties from all accessible accounts are aggregated.

ga_get_propertyA

Get details about the configured GA4 property.

ga_list_data_streamsA

List data streams for the configured GA4 property.

Use this to find measurement IDs for Measurement Protocol.

ga_run_pivot_reportA

Run a pivot table report with row and column dimensions.

⚠️ TOKEN OPTIMIZATION: Pivot reports can be VERY large. Limit dimensions and use small date ranges. Recommended for analysis, not raw data extraction.

ga_run_funnel_reportA

Run a funnel analysis report to track user progression through steps (Data API v1alpha).

Each step matches an event: set 'eventName' per step (defaults to the step name). For advanced matching, pass a full 'filterExpression' instead.

ga_batch_run_reportsA

Run multiple reports in a single request.

⚠️ TOKEN OPTIMIZATION: Can return LARGE amounts of data. Limit to 2-5 reports per batch. Each report should have small limits.

ga_send_eventA

Send a custom event to Google Analytics via Measurement Protocol.

Use this for tracking custom user actions, conversions, or any GA4 event. Events are processed asynchronously and appear in reports within minutes.

Common events: click, form_submit, video_play, file_download, custom_conversion

ga_validate_eventA

Validate an event before sending it to Google Analytics.

Uses GA4's debug endpoint to check for errors without recording the event. Returns validation messages and errors if any.

ga_send_pageviewA

Send a page view event to Google Analytics.

Standard event for tracking page/screen views. Automatically uses 'page_view' event name.

ga_send_purchaseA

Send an ecommerce purchase event to Google Analytics.

Standard event for tracking completed purchases with transaction details and items.

ga_send_loginA

Send a login event to Google Analytics.

Standard event for tracking user logins with authentication method.

ga_send_signupA

Send a sign-up event to Google Analytics.

Standard event for tracking new user registrations.

ga_send_add_to_cartA

Send an add to cart event to Google Analytics.

Ecommerce event for tracking when items are added to shopping cart.

ga_send_begin_checkoutA

Send a begin checkout event to Google Analytics.

Ecommerce event for tracking when users start the checkout process.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/leonardosepulvedat/mcp-google-analytics'

If you have feedback or need assistance with the MCP directory API, please join our Discord server