Skip to main content
Glama

Tag Manager: Install tracking

gtm_install_tracking
Destructive

Install tracking on ANY website through its Google Tag Manager container: the Analytics tag (ga4_id), and Google Ads conversions for a form lead (ads_id + conversion_label + the thank-you page path) and for a tap on the phone number (ads_id + phone_click_label). With an Ads conversion it also adds the Conversion Linker; Tag Manager itself adds its Google tag for the Ads account ("Google Ads AW-…") when the conversion tag is created, and the preview says so. The result lists what the workspace holds afterwards (in_workspace). IDs only — never code. Skips what the container already has. Previews unless confirm is true; the tags reach the live site only when publish is true as well. 🔴 The container's own GTM-… snippet must already be on the site (site_check shows whether it is); this tool cannot put it there.

Input Schema

NameRequiredDescriptionDefault
ads_idNoGoogle Ads conversion id, AW-… or digits, from ads_list_conversion_actions
ga4_idNoAnalytics measurement id, G-…
confirmNoLeave false to preview: nothing changes and the preview shows exactly what would happen. Set true only after the user has agreed to this exact change.
publishNoCreate a version and publish it, so the tags go live. Only when the person has said to make it live.
containerYesGTM-… public id or container id from gtm_list_containers
conversion_pathNoThank-you page path the form lands on, e.g. /thank-you/
conversion_labelNoConversion label for the form lead (WEBPAGE conversion action)
phone_click_labelNoConversion label for the phone tap (WEBPAGE conversion action named e.g. Phone click)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations by disclosing the two-step confirm/publish gating, that existing tags are skipped, that a Conversion Linker and Google's own Ads tag are added as side effects, that the response lists what the workspace holds (in_workspace), and that it accepts IDs only and never code. This is exactly the extra mutation context an agent needs for a destructiveHint tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense but front-loaded: the primary action and its outputs come first, then the preview/publish gate, then the prerequisite warning. A couple of clauses (the Google Ads AW-… aside, 'and the preview says so') are marginally redundant but still carry information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter destructive mutation with no output schema, the description covers the safety gating, prerequisites, side effects, and the shape of the result. Nothing an agent needs to invoke this safely is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3, but the description adds real meaning by explaining how parameters combine: ga4_id drives the Analytics tag, while ads_id + conversion_label + conversion_path build the form-lead conversion and ads_id + phone_click_label build the phone-tap conversion. That relational mapping is not derivable from the flat schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (install tracking into a GTM container) and enumerates exactly what gets created: a GA4 Analytics tag and Google Ads conversions for a form lead and a phone tap. This clearly separates it from siblings like gtm_list_containers, gtm_tracking_status, and wp_install_tracking.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear operating context: preview by default, live only when both confirm and publish are true, and it skips what the container already holds. It also states a hard prerequisite (the GTM-… snippet must already be on the site, verifiable via site_check). It stops short of explicitly naming an alternative tool (e.g. wp_install_tracking) for WordPress sites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.