Google Analytics

Google Analytics 4 Admin and Data API for property configuration and reporting

14 tools available

Installation

Claude Desktop

{
  "mcpServers": {
    "hopkin-ga4": {
      "url": "https://ga4.mcp.hopkin.ai",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

CLI

npm install -g @hopkin/cli
hopkin auth set-key hpk_live_...
hopkin ga4 ping

Tools

-account-summaries

ga4_list_account_summaries List GA4 Accounts & Properties

Read-onlyOpen-world

List every GA4 account and property visible to the connected Google account (Admin API accountSummaries). Use this tool first to discover which properties are available before calling other GA4 tools. Results are cached; pass refresh=true only when you need the latest list. Args: limit (number, optional): Max accounts per page (default 20, max 200). cursor (string, optional): Opaque pagination cursor from a previous response's pagination.nextCursor. refresh (bool, optional): Force a fresh fetch from the API, bypassing cache. Default: false. Returns: data: accounts (each with account resource name, display_name, and properties[] of { property_id, display_name, property_type, parent }). count (total accounts), property_count (total properties), cached, synced_at, and pagination { hasMore, nextCursor }.

ParameterTypeDescription
reason requiredstringWhy this tool call is needed
3 optional parameters
ParameterTypeDescription
limitintegerMax accounts per page (default 20).
cursorstringOpaque pagination cursor from a previous response's pagination.nextCursor. Do not construct by hand.
refreshbooleanForce a fresh fetch from the Admin API, bypassing the cache. Default: false.
View full documentation →

k-auth-status

ga4_check_auth_status Check GA4 Auth Status

Read-onlyIdempotent

Troubleshoot authentication issues. Only use this when another tool fails with a permission or auth error — do NOT call proactively. Returns: authenticated status, user_id, email, and a human-readable message.

ParameterTypeDescription
reason requiredstringWhy this tool call is needed
View full documentation →

-connections

ga4_list_connections List Google Analytics Connections

Read-onlyIdempotent

List the Google Analytics connections available to you — both ones you own and ones shared with you via an organization. Only Google connections with Google Analytics (analytics.readonly) scope are returned. Use this to discover connection IDs for set_default / share / rename / revoke.

ParameterTypeDescription
reason requiredstringWhy this tool call is needed
View full documentation →

default-connection

ga4_set_default_connection Set Default Google Analytics Connection

Read-onlyIdempotent

Set the Google Analytics connection that should be used by default for subsequent GA4 tool calls. The default is scoped to the calling actor (your user account, or the API key being used).

ParameterTypeDescription
connection_id requiredstringUUID of the connection to mark as the actor's default Google Analytics connection.
reason requiredstringWhy this tool call is needed
View full documentation →

e-connection

ga4_share_connection Share Google Analytics Connection With Organization

Idempotent

Share an owned Google Analytics connection with all members of your organization, so teammates can use it without having to reconnect Google themselves. You must be the owner of the connection.

ParameterTypeDescription
connection_id requiredstringUUID of the connection to mark as the actor's default Google Analytics connection.
reason requiredstringWhy this tool call is needed
View full documentation →

are-connection

ga4_unshare_connection Unshare Google Analytics Connection From Organization

DestructiveIdempotent

Stop sharing an owned Google Analytics connection with your organization. Teammates lose access immediately. You must be the owner.

ParameterTypeDescription
connection_id requiredstringUUID of the connection to mark as the actor's default Google Analytics connection.
reason requiredstringWhy this tool call is needed
View full documentation →

me-connection

ga4_rename_connection Rename Google Analytics Connection

Idempotent

Rename the display name of an owned Google Analytics connection. The OAuth grant and underlying account are unaffected — this only changes the human-readable label. You must be the owner.

ParameterTypeDescription
connection_id requiredstringUUID of the connection to mark as the actor's default Google Analytics connection.
reason requiredstringWhy this tool call is needed
View full documentation →

ke-connection

ga4_revoke_connection Revoke Google Analytics Connection

DestructiveIdempotent

Revoke (soft-delete) an owned Google Analytics connection. Any defaults pointing to it are invalidated and shared org members lose access. The OAuth grant at Google is NOT revoked by this tool — the user must disconnect via the dashboard if they want to fully revoke at Google. You must be the owner.

ParameterTypeDescription
connection_id requiredstringUUID of the connection to mark as the actor's default Google Analytics connection.
reason requiredstringWhy this tool call is needed
View full documentation →

loper-feedback

ga4_developer_feedback Submit Developer Feedback

IdempotentOpen-world

Submit feedback about missing tools, improvements, bugs, or workflow gaps in the GA4 MCP toolset. Not for user-facing issues (auth errors, API errors). Args: feedback_type: new_tool, improvement, bug, workflow_gap title: Short description (5-200 chars) description: What is needed and why (20-2000 chars) current_workaround (optional): How you're working around the gap priority (optional): low, medium (default), high Returns: confirmation that feedback was recorded.

ParameterTypeDescription
feedback_type requiredstringFeedback category: new_tool (request new capability), improvement (enhance existing tool), bug (report issue), workflow_gap (missing workflow)
title requiredstringConcise title summarizing the feedback
description requiredstringWhat is needed and why
reason requiredstringWhy this tool call is needed
3 optional parameters
ParameterTypeDescription
current_workaroundstringCurrent workaround, if any
prioritystringImpact level: low (nice-to-have), medium (improves workflow), high (blocking issue)
interfacestringInterface the feedback originated from: MCP (default) or CLI
View full documentation →

metadata

ga4_get_metadata Get GA4 Dimensions & Metrics

Read-onlyOpen-world

List the dimensions and metrics available on a GA4 property (including custom definitions), so ga4_run_report calls use valid API names instead of guessing. Args: property_id (string, required): GA4 property ID (numeric) or full resource name. search (string, optional): Case-insensitive substring filter on API name / UI name (e.g. 'channel', 'revenue'). Omit to list everything. Returns: dimension_count, metric_count, and matching dimensions/metrics with api_name, ui_name, category, type (metrics), and custom flag.

ParameterTypeDescription
property_id requiredstringGA4 property ID (numeric) or full resource name.
reason requiredstringWhy this tool call is needed
1 optional parameter
ParameterTypeDescription
searchstringCase-insensitive substring filter on API name / UI name (e.g. 'channel', 'revenue'). Omit to list everything.
View full documentation →

Uncategorized

ga4_ping Ping GA4 MCP Server

Read-onlyIdempotent

Health check. Returns server status, version, and timestamp.

ParameterTypeDescription
reason requiredstringWhy this tool call is needed
1 optional parameter
ParameterTypeDescription
messagestringOptional message to echo back
View full documentation →

property-details

ga4_get_property_details Get GA4 Property Details

Read-onlyOpen-world

Setup-health snapshot for one GA4 property: property info, data streams (with enhanced measurement settings for web streams), key events, Google Ads links, attribution settings, and data retention settings. Sections that fail to load are returned with an error string instead of failing the whole call. Args: property_id (string, required): GA4 property ID (numeric, e.g. '123456789') or full resource name ('properties/123456789'). Returns: property, data_streams, key_events, google_ads_links, attribution_settings, data_retention_settings — each either the API payload or { error }.

ParameterTypeDescription
property_id requiredstringGA4 property ID (numeric, e.g. '123456789') or full resource name ('properties/123456789').
reason requiredstringWhy this tool call is needed
View full documentation →

report

ga4_run_report Run GA4 Report

Read-onlyOpen-world

Run a GA4 report (Data API runReport): arbitrary dimensions × metrics over one or more date ranges, with an optional simple dimension filter and ordering. Use ga4_get_metadata first to look up valid dimension/metric API names. Args: property_id (string, required): GA4 property ID (numeric) or full resource name. dimensions (string[], optional): Up to 9 dimension API names (e.g. sessionDefaultChannelGroup, date). metrics (string[], required): 1-10 metric API names (e.g. sessions, totalUsers, keyEvents, purchaseRevenue). date_ranges (array, required): 1-4 ranges of { start_date, end_date, name? }. Dates are YYYY-MM-DD or relative (30daysAgo, yesterday, today). dimension_filter (object, optional): Single-field filter { field, values[], match_type?, case_sensitive?, negate? }. order_by (object, optional): { type: 'metric'|'dimension', name, desc? }. limit (number, optional): Max rows, default 100, max 10000. offset (number, optional): Row offset for pagination. Returns: row_count (total rows before pagination), returned_rows, and rows flattened as { dimension: value, metric: value } objects. For a single date range: metric_totals ({ metric: total }). For multiple date ranges: metric_totals_by_range ({ "date_range_0": { metric: total }, ... }) keyed by the dateRange dimension value (or the range's name).

ParameterTypeDescription
property_id requiredstringGA4 property ID (numeric) or full resource name.
metrics requiredarrayGA4 metric API names, e.g. sessions, totalUsers, keyEvents, purchaseRevenue.
date_ranges requiredarrayOne to 4 date ranges.
reason requiredstringWhy this tool call is needed
5 optional parameters
ParameterTypeDescription
dimensionsarrayGA4 dimension API names, e.g. sessionDefaultChannelGroup, landingPagePlusQueryString, date. Use ga4_get_metadata for valid names.
dimension_filterobjectSimple single-field dimension filter.
order_byobject
limitintegerMax rows (default 100). Range: 1-10000.
offsetintegerRow offset for pagination.
View full documentation →

realtime-report

ga4_run_realtime_report Run GA4 Realtime Report

Read-onlyOpen-world

Run a GA4 realtime report (last 30 minutes of events). Primary use: verifying tags and key events fire after a tracking change, without waiting for standard processing lag. Args: property_id (string, required): GA4 property ID (numeric) or full resource name. dimensions (string[], optional): Up to 9 realtime dimension API names (e.g. eventName, unifiedScreenName, country, deviceCategory). metrics (string[], required): 1-10 realtime metric API names (e.g. activeUsers, eventCount, keyEvents). limit (number, optional): Max rows, default 50. Returns: row_count and rows flattened as { dimension: value, metric: value } objects.

ParameterTypeDescription
property_id requiredstringGA4 property ID (numeric) or full resource name.
metrics requiredarrayRealtime metric API names, e.g. activeUsers, eventCount, keyEvents.
reason requiredstringWhy this tool call is needed
2 optional parameters
ParameterTypeDescription
dimensionsarrayRealtime dimension API names, e.g. eventName, unifiedScreenName, country, deviceCategory.
limitintegerMax rows (default 50).
View full documentation →