Skip to main content
Glama

Set up GA4 ecommerce event tags (🟡 recipe)

gtm_setup_ga4_ecommerce_events

Plan or apply GA4 ecommerce event setup in a Google Tag Manager workspace: create missing Custom Event triggers and GA4 event tags, reuse existing assets, and report paused-only events.

Instructions

Plan (dry_run=true, default) or apply (dry_run=false) the standard GA4 ecommerce set in a workspace: for every missing event (view_item_list … purchase, refund; or the events you pass) one Custom Event trigger (dataLayer.push({event: 'purchase', ecommerce: {...}})) + one GA4 event tag with 'send ecommerce data'. Existing triggers/tags are reused, events that only have paused tags are reported (not duplicated). measurement_id = G-XXXXXXXX or {{GA4 Measurement ID}}. Nothing goes live until gtm_create_version + gtm_publish_version.

Input Schema

NameRequiredDescriptionDefault
eventsNo
dry_runNo
containerYes
tag_prefixNoGA4 - Event -
workspace_idNo
measurement_idYes
trigger_prefixNoCE -
include_optional_eventsNo
add_google_tag_if_missingNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the annotations (which only say non-read-only, non-destructive, non-idempotent, open-world), the description discloses the key mutation semantics: existing triggers/tags are reused, events covered only by paused tags are reported rather than duplicated, and nothing is published until a version is created and published. It also gives the accepted measurement_id formats. That's substantial added behavioral context, not a restatement of annotations.

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?

Front-loaded with the plan/apply distinction and the core output (trigger + tag per event), then supporting details in descending importance; the final sentence about publishing gates is well placed. It is dense — parenthetical event-name lists and payload examples make it slower to parse than it needs to be — but no sentence is filler.

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

Completeness4/5

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

An output schema exists, so return values need not be explained, and the description covers purpose, safety gating, reuse/dedup behavior, and the publish workflow — enough for an agent to call this confidently. The remaining hole is the set of behavior-altering flags (include_optional_events, add_google_tag_if_missing), which an agent cannot reason about from the description alone.

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

Parameters2/5

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

Schema description coverage is 0% across 9 parameters, so the description carries the whole burden. It explains only three: dry_run (with its default), events (subset selection), and measurement_id (accepted formats). Six parameters — container, workspace_id, tag_prefix, trigger_prefix, include_optional_events, add_google_tag_if_missing — are opaque in both schema and description, and the last two materially change what gets created.

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?

The description states a specific verb pair (plan/apply) and a concrete resource composition: one Custom Event trigger plus one GA4 event tag per missing ecommerce event, in a named workspace. It also names the concrete artifacts ('send ecommerce data', dataLayer.push payload), so an agent can tell this bulk recipe apart from the singular gtm_create_ga4_event_tag / gtm_create_trigger siblings without opening the schema.

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?

It gives explicit default behavior (dry_run=true plans, dry_run=false applies), a scoping option (`events` subset), and a clear workflow gate: 'Nothing goes live until gtm_create_version + gtm_publish_version.' What's missing is an explicit statement of when to prefer this over the singular tag/trigger creators, so the alternative is only implied.

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