mcp-google-analytics
v1.3.0GA4 MCP that reads AND writes: reports, funnels, audits, and server-side events.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
ga_run_report
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
| Parameter | Type | Description |
|---|---|---|
dateRanges * | array | Date ranges for the report |
metrics * | array | Metrics to measure (e.g., [{name: "activeUsers"}]) |
dimensionFilter | object | Dimension filter expression |
dimensions | array | Dimensions to group by (e.g., [{name: "date"}]) |
limit | integer | Maximum number of rows to return (default: 10) |
metricFilter | object | Metric filter expression |
offset | integer | Number of rows to skip (for pagination) |
orderBys | array | Sorting specification |
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_run_realtime_report
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
| Parameter | Type | Description |
|---|---|---|
metrics * | array | Metrics to measure |
dimensions | array | Dimensions to group by |
limit | integer | Maximum number of rows (default: 10) |
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_get_metadata
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.
| Parameter | Type | Description |
|---|---|---|
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_list_accounts
List all Google Analytics accounts accessible to the service account. Use this to find account IDs for listing properties.
ga_list_properties
List Google Analytics properties. Optionally filter by account ID. Without an account ID, properties from all accessible accounts are aggregated.
| Parameter | Type | Description |
|---|---|---|
accountId | string | Optional account ID to filter properties (e.g., "123456789") |
ga_get_property
Get details about a GA4 property (the configured one, or any accessible property via propertyId).
| Parameter | Type | Description |
|---|---|---|
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_list_data_streams
List data streams for the configured GA4 property. Use this to find measurement IDs for Measurement Protocol.
| Parameter | Type | Description |
|---|---|---|
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_run_pivot_report
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.
| Parameter | Type | Description |
|---|---|---|
dateRanges * | array | |
metrics * | array | |
pivots * | array | Pivot specifications with fieldNames |
dimensions | array | |
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_run_funnel_report
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.
| Parameter | Type | Description |
|---|---|---|
dateRanges * | array | |
funnelSteps * | array | Steps in the funnel |
funnelBreakdown | object | Optional dimension to break down funnel |
funnelVisualizationType | string | |
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_batch_run_reports
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.
| Parameter | Type | Description |
|---|---|---|
requests * | array | Array of report requests (same format as ga_run_report) |
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_get_account_summaries
Get a compact overview of all accessible GA accounts and their properties in a single call. The fastest way to discover account IDs, property IDs, and property names.
ga_list_custom_dimensions
List all custom dimensions defined for the configured GA4 property. Use this to discover custom dimension API names (e.g., "customEvent:plan_type") for reports.
| Parameter | Type | Description |
|---|---|---|
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_list_custom_metrics
List all custom metrics defined for the configured GA4 property. Use this to discover custom metric API names for reports.
| Parameter | Type | Description |
|---|---|---|
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_list_key_events
List the key events (conversions) configured for the GA4 property. Useful to know which event names count as conversions before building reports or sending events.
| Parameter | Type | Description |
|---|---|---|
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_list_google_ads_links
List Google Ads accounts linked to a GA4 property.
| Parameter | Type | Description |
|---|---|---|
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_check_compatibility
Check whether a combination of dimensions and metrics is valid for this property BEFORE running a report. Avoids wasted report requests and token-heavy error loops. Also lists which other fields remain compatible with the given combination.
| Parameter | Type | Description |
|---|---|---|
compatibilityFilter | string | Only return fields with this compatibility (recommended: COMPATIBLE) |
dimensions | array | Dimensions to check (e.g., [{name: "city"}]) |
metrics | array | Metrics to check (e.g., [{name: "activeUsers"}]) |
propertyId | string | GA4 property ID to query (overrides the default GA_PROPERTY_ID). Accepts "123456789" or "properties/123456789". Use ga_get_account_summaries to discover IDs. |
ga_send_event
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
| Parameter | Type | Description |
|---|---|---|
events * | array | Events to send (can send multiple in one request) |
client_id | string | Client ID (UUID format recommended). Auto-generated if not provided. |
user_id | string | Optional User ID for cross-device tracking |
user_properties | object | User properties (e.g., {subscription_tier: {value: "premium"}}) |
ga_validate_event
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.
| Parameter | Type | Description |
|---|---|---|
events * | array | |
client_id | string | |
user_id | string | |
user_properties | object | User properties (e.g., {subscription_tier: {value: "premium"}}) |
ga_send_pageview
Send a page view event to Google Analytics. Standard event for tracking page/screen views. Automatically uses 'page_view' event name.
| Parameter | Type | Description |
|---|---|---|
page_location * | string | Full URL of the page |
client_id | string | Client ID (auto-generated if not provided) |
page_referrer | string | Referrer URL |
page_title | string | Page title |
user_id | string | Optional User ID |
user_properties | object | User properties (e.g., {subscription_tier: {value: "premium"}}) |
ga_send_purchase
Send an ecommerce purchase event to Google Analytics. Standard event for tracking completed purchases with transaction details and items.
| Parameter | Type | Description |
|---|---|---|
currency * | string | Currency code (e.g., USD, EUR) |
items * | array | Purchased items |
transaction_id * | string | Unique transaction ID |
value * | number | Total purchase value |
affiliation | string | Store or affiliation |
client_id | string | |
coupon | string | Coupon code used |
shipping | number | Shipping cost |
tax | number | Tax amount |
user_id | string | |
user_properties | object | User properties (e.g., {subscription_tier: {value: "premium"}}) |
ga_send_login
Send a login event to Google Analytics. Standard event for tracking user logins with authentication method.
| Parameter | Type | Description |
|---|---|---|
method * | string | Login method (e.g., "Google", "Email", "Facebook") |
client_id | string | |
user_id | string | User ID (recommended for login events) |
user_properties | object | User properties (e.g., {subscription_tier: {value: "premium"}}) |
ga_send_signup
Send a sign-up event to Google Analytics. Standard event for tracking new user registrations.
| Parameter | Type | Description |
|---|---|---|
method * | string | Sign-up method (e.g., "Google", "Email") |
client_id | string | |
user_id | string | User ID for the new user |
user_properties | object | User properties (e.g., {subscription_tier: {value: "premium"}}) |
ga_send_add_to_cart
Send an add to cart event to Google Analytics. Ecommerce event for tracking when items are added to shopping cart.
| Parameter | Type | Description |
|---|---|---|
currency * | string | Currency code |
items * | array | Items added to cart |
value * | number | Total value of items added |
client_id | string | |
user_id | string | |
user_properties | object | User properties (e.g., {subscription_tier: {value: "premium"}}) |
ga_send_begin_checkout
Send a begin checkout event to Google Analytics. Ecommerce event for tracking when users start the checkout process.
| Parameter | Type | Description |
|---|---|---|
currency * | string | Currency code |
items * | array | Items in checkout |
value * | number | Total value of cart |
client_id | string | |
coupon | string | Coupon code applied |
user_id | string | |
user_properties | object | User properties (e.g., {subscription_tier: {value: "premium"}}) |
ga_send_view_item
Send a view item event to Google Analytics. Ecommerce event for tracking product/item detail views. Completes the standard funnel: view_item → add_to_cart → begin_checkout → purchase.
| Parameter | Type | Description |
|---|---|---|
currency * | string | Currency code |
items * | array | Items viewed |
value * | number | Value of the viewed item(s) |
client_id | string | |
user_id | string | |
user_properties | object | User properties (e.g., {subscription_tier: {value: "premium"}}) |
ga_send_refund
Send a refund event to Google Analytics. Ecommerce event for full or partial refunds. Omit 'items' for a full refund; include them (with quantities) for a partial refund. Use the same transaction_id as the original purchase.
| Parameter | Type | Description |
|---|---|---|
transaction_id * | string | Transaction ID of the original purchase |
client_id | string | |
currency | string | Currency code |
items | array | Refunded items (only for partial refunds) |
user_id | string | |
user_properties | object | User properties (e.g., {subscription_tier: {value: "premium"}}) |
value | number | Refunded amount |