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
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 }.
| Parameter | Type | Description |
|---|---|---|
reason required | string | Why this tool call is needed |
3 optional parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max accounts per page (default 20). |
cursor | string | Opaque pagination cursor from a previous response's pagination.nextCursor. Do not construct by hand. |
refresh | boolean | Force a fresh fetch from the Admin API, bypassing the cache. Default: false. |
k-auth-status
ga4_check_auth_status Check GA4 Auth Status
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.
| Parameter | Type | Description |
|---|---|---|
reason required | string | Why this tool call is needed |
-connections
ga4_list_connections List Google Analytics Connections
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.
| Parameter | Type | Description |
|---|---|---|
reason required | string | Why this tool call is needed |
default-connection
ga4_set_default_connection Set Default Google Analytics Connection
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).
| Parameter | Type | Description |
|---|---|---|
connection_id required | string | UUID of the connection to mark as the actor's default Google Analytics connection. |
reason required | string | Why this tool call is needed |
e-connection
are-connection
me-connection
ga4_rename_connection Rename Google Analytics Connection
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.
| Parameter | Type | Description |
|---|---|---|
connection_id required | string | UUID of the connection to mark as the actor's default Google Analytics connection. |
reason required | string | Why this tool call is needed |
ke-connection
ga4_revoke_connection Revoke Google Analytics Connection
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.
| Parameter | Type | Description |
|---|---|---|
connection_id required | string | UUID of the connection to mark as the actor's default Google Analytics connection. |
reason required | string | Why this tool call is needed |
loper-feedback
ga4_developer_feedback Submit Developer Feedback
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.
| Parameter | Type | Description |
|---|---|---|
feedback_type required | string | Feedback category: new_tool (request new capability), improvement (enhance existing tool), bug (report issue), workflow_gap (missing workflow) |
title required | string | Concise title summarizing the feedback |
description required | string | What is needed and why |
reason required | string | Why this tool call is needed |
3 optional parameters
| Parameter | Type | Description |
|---|---|---|
current_workaround | string | Current workaround, if any |
priority | string | Impact level: low (nice-to-have), medium (improves workflow), high (blocking issue) |
interface | string | Interface the feedback originated from: MCP (default) or CLI |
metadata
ga4_get_metadata Get GA4 Dimensions & Metrics
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.
| Parameter | Type | Description |
|---|---|---|
property_id required | string | GA4 property ID (numeric) or full resource name. |
reason required | string | Why this tool call is needed |
1 optional parameter
| Parameter | Type | Description |
|---|---|---|
search | string | Case-insensitive substring filter on API name / UI name (e.g. 'channel', 'revenue'). Omit to list everything. |
Uncategorized
ga4_ping Ping GA4 MCP Server
Health check. Returns server status, version, and timestamp.
| Parameter | Type | Description |
|---|---|---|
reason required | string | Why this tool call is needed |
1 optional parameter
| Parameter | Type | Description |
|---|---|---|
message | string | Optional message to echo back |
property-details
ga4_get_property_details Get GA4 Property Details
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 }.
| Parameter | Type | Description |
|---|---|---|
property_id required | string | GA4 property ID (numeric, e.g. '123456789') or full resource name ('properties/123456789'). |
reason required | string | Why this tool call is needed |
report
ga4_run_report Run GA4 Report
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).
| Parameter | Type | Description |
|---|---|---|
property_id required | string | GA4 property ID (numeric) or full resource name. |
metrics required | array | GA4 metric API names, e.g. sessions, totalUsers, keyEvents, purchaseRevenue. |
date_ranges required | array | One to 4 date ranges. |
reason required | string | Why this tool call is needed |
5 optional parameters
| Parameter | Type | Description |
|---|---|---|
dimensions | array | GA4 dimension API names, e.g. sessionDefaultChannelGroup, landingPagePlusQueryString, date. Use ga4_get_metadata for valid names. |
dimension_filter | object | Simple single-field dimension filter. |
order_by | object | |
limit | integer | Max rows (default 100). Range: 1-10000. |
offset | integer | Row offset for pagination. |
realtime-report
ga4_run_realtime_report Run GA4 Realtime Report
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.
| Parameter | Type | Description |
|---|---|---|
property_id required | string | GA4 property ID (numeric) or full resource name. |
metrics required | array | Realtime metric API names, e.g. activeUsers, eventCount, keyEvents. |
reason required | string | Why this tool call is needed |
2 optional parameters
| Parameter | Type | Description |
|---|---|---|
dimensions | array | Realtime dimension API names, e.g. eventName, unifiedScreenName, country, deviceCategory. |
limit | integer | Max rows (default 50). |