google-analytics-gtm-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GOOGLE_APPLICATION_CREDENTIALS | Yes | Path to the Google Cloud service account JSON key file. |
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
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_account_summariesA | List every GA4 account and its properties the service account can see. Returns account name/id plus each property's display name and numeric id. Call this first to discover property ids for the other GA4 tools. |
| get_property_detailsA | Get configuration details for one GA4 property (name, time zone, currency, industry, create time). |
| list_data_streamsA | List the data streams (web/app) on a GA4 property. The stream id (last path segment of 'name') is needed by the Measurement Protocol secret tools. |
| run_reportC | Run a GA4 report. metrics/dimensions are GA4 API names (e.g. metrics ['activeUsers','conversions'], dimensions ['date','sessionDefaultChannelGroup']). Dates accept YYYY-MM-DD or relative forms like '28daysAgo' / 'today'. |
| run_realtime_reportA | Run a GA4 realtime report (last ~30 minutes). Example: metrics ['activeUsers'], dimensions ['country','unifiedScreenName']. |
| list_custom_dimensionsA | List custom dimensions defined on a GA4 property. |
| create_custom_dimensionB | Create a custom dimension. parameter_name is the event parameter / user property key; scope is 'EVENT', 'USER' or 'ITEM'. display_name may contain only letters, numbers, underscores and spaces. |
| archive_custom_dimensionB | Archive (delete) a custom dimension. custom_dimension_id may be the numeric id or the full 'properties/NNN/customDimensions/MMM' name. |
| list_custom_metricsB | List custom metrics defined on a GA4 property. |
| create_custom_metricC | Create a custom metric. measurement_unit is one of STANDARD, CURRENCY, FEET, METERS, KILOMETERS, MILES, MILLISECONDS, SECONDS, MINUTES, HOURS. |
| list_key_eventsB | List key events (conversions) on a GA4 property. |
| create_key_eventA | Mark an event as a key event (conversion). counting_method is 'ONCE_PER_EVENT' or 'ONCE_PER_SESSION'. |
| list_audiencesB | List audiences defined on a GA4 property. |
| create_event_audienceA | Create a GA4 audience of users who triggered a given event (e.g. 'purchase', 'generate_lead') — useful for remarketing lists that can be shared to Google Ads. membership_duration_days is how long a user stays in the audience (max 540). |
| archive_audienceA | Archive a GA4 audience. audience_id may be the numeric id or the full 'properties/NNN/audiences/MMM' name. |
| list_measurement_protocol_secretsA | List Measurement Protocol API secrets for a data stream. stream_id is the numeric id from list_data_streams. |
| create_measurement_protocol_secretA | Create a Measurement Protocol API secret on a data stream. Returns the secret_value (api_secret) needed by send_ga4_event. Treat it as sensitive. |
| delete_measurement_protocol_secretB | Delete a Measurement Protocol API secret. secret_id may be the numeric id or the full resource name. |
| send_ga4_eventA | Send an event into a GA4 property via the Measurement Protocol. measurement_id is the stream's 'G-XXXXXXX'; api_secret comes from a Measurement Protocol secret; client_id identifies the user/device. Set validate=True to hit GA4's debug/validation endpoint (checks the payload WITHOUT ingesting it) — recommended before real sends. |
| gtm_whoamiA | Show which service-account identity and scopes this server uses for GTM, and how many GTM accounts it can currently see. Use this to verify access after granting the service account permission in Tag Manager. |
| gtm_list_accountsA | List all GTM accounts the service account can access. |
| gtm_list_containersB | List containers in a GTM account. |
| gtm_list_workspacesC | List workspaces in a container. |
| gtm_list_tagsB | List tags in a workspace. |
| gtm_list_triggersC | List triggers in a workspace. |
| gtm_list_variablesB | List variables in a workspace. |
| gtm_get_tagC | Get a single tag by id. |
| gtm_list_versionsA | List container version headers (published + saved versions). |
| gtm_get_live_versionC | Get the currently live (published) container version. |
| gtm_create_tagB | Create a tag. tag_json is the full GTM Tag resource as a JSON string, e.g. {"name":"GA4 Config","type":"gaawc","parameter":[...], "firingTriggerId":["2147479553"]}. |
| gtm_update_tagA | Update an existing tag with a full GTM Tag resource (JSON string). |
| gtm_delete_tagA | Delete a tag. Requires confirm=true. |
| gtm_create_triggerB | Create a trigger from a full GTM Trigger resource (JSON string). |
| gtm_update_triggerB | Update an existing trigger with a full GTM Trigger resource (JSON string). |
| gtm_delete_triggerB | Delete a trigger. Requires confirm=true. |
| gtm_create_variableB | Create a variable from a full GTM Variable resource (JSON string). |
| gtm_update_variableA | Update an existing variable with a full GTM Variable resource (JSON string). |
| gtm_delete_variableB | Delete a variable. Requires confirm=true. |
| gtm_create_versionA | Freeze the current workspace into a new container version. Returns the new containerVersion (with containerVersionId) plus any compiler errors. This does NOT publish; use gtm_publish_version next. |
| gtm_publish_versionA | Publish a container version to live. Requires confirm=true because this affects the live site. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 40 tools
Every tool targets a distinct resource and action. The gtm_ prefix cleanly separates GTM tools from GA4 tools, and each list/get/create/update/delete/send tool maps to a unique resource (reports, dimensions, metrics, key events, audiences, secrets, tags, triggers, variables, versions). There is no overlap or ambiguity.
Most tools follow a verb_noun pattern, but the GA4 tools use bare verbs (list_, create_, archive_) while GTM tools are prefixed with gtm_ (gtm_list_, gtm_create_), which is a visible deviation. Also, 'get_property_details' doesn't align with 'list_account_summaries', 'send_ga4_event' and 'gtm_whoami' break the pattern, and archive vs delete is used inconsistently. Still, within each domain the pattern is fairly regular.
40 tools is well above the 25+ threshold that typically feels too heavy for an MCP server. Even though the server covers two distinct APIs (GA4 and GTM), the number of tools will clutter the agent's context and many are narrowly scoped (e.g., separate create/update/delete for three GTM resources). The count is excessive for practical use.
The server covers a broad range of GA4 and GTM operations, but there are notable gaps: no update for custom dimensions/metrics (only archive for dimensions), no update/delete for key events, no update for audiences, no update for measurement protocol secrets, and no GTM container/workspace creation or deletion. These gaps are workable but represent missing lifecycle operations in the domain.