Skip to main content
Glama
burhan29ee

google-analytics-gtm-mcp

by burhan29ee

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GOOGLE_APPLICATION_CREDENTIALSYesPath to the Google Cloud service account JSON key file.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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

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/burhan29ee/google-analytics-gtm-mcp'

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