gtm-tag-architect
gtm-tag-architect
Un plugin público y listo para producción para Google Antigravity y Claude Code que se conecta a Google Tag Manager mediante MCP.
Proporciona un comando interactivo /setup que entrevista a desarrolladores y especialistas en marketing sobre su sitio, diagnostica defectos del contenedor (duplicados, disparadores faltantes, violaciones de Consent Mode v2) y genera taxonomías de seguimiento optimizadas y contratos de dataLayer.
Características
Comando interactivo
/setup: Te guía a través de un flujo de trabajo de entrevista y auditoría en 3 etapas.Diagnóstico profundo del contenedor: Audita etiquetas GA4/Meta duplicadas, disparadores huérfanos, píxeles de marketing sin consentimiento y scripts que bloquean el renderizado.
Remediación automatizada: Deduplica etiquetas y aplica Google Consent Mode v2 en todas las etiquetas.
Matrices de seguimiento por industria: Runbooks de taxonomía predefinidos para comercio electrónico, SaaS/PLG y generación de leads B2B.
Generador de
dataLayer.d.tspara desarrolladores: Genera contratos de eventos tipados y funciones auxiliares de push para aplicaciones React, Next.js y vanilla.Servidor MCP de doble modo: Funciona en vivo contra la API REST v2 de Google Tag Manager o audita archivos JSON de contenedor exportados localmente sin conexión.
Related MCP server: mcp-gtm-ga4
Instalación y configuración
Para Google Antigravity
Clona o coloca este repositorio en tu espacio de trabajo o en el directorio de personalizaciones globales:
# In your project's .agents/plugins/ or ~/.gemini/config/plugins/
git clone https://github.com/jarnielcataluna/gtm-tag-architect.gitAntigravity descubrirá automáticamente el plugin, expondrá el comando de barra /setup y registrará el servidor MCP definido en mcp_config.json.
Para Claude Code / MCP independiente
Registra el servidor en tu claude_desktop_config.json o en la configuración MCP del proyecto:
{
"mcpServers": {
"gtm-tag-architect": {
"command": "node",
"args": ["/path/to/gtm-tag-architect/bin/gtm-mcp.js"]
}
}
}Uso
Ejecuta el comando /setup
Dentro de Antigravity o Claude Code:
/setupEl agente te entrevistará sobre:
Tipo de sitio e industria (comercio electrónico, SaaS, generación de leads, contenido)
Píxeles requeridos (GA4, Meta, LinkedIn, Google Ads, PostHog)
Requisitos de privacidad (GDPR / Consent Mode v2)
Luego realiza una auditoría de diagnóstico y te presenta un menú de acciones para corregir defectos, aplicar reglas de consentimiento o exportar un dataLayer.d.ts limpio.
Pruebas y auditoría local
Puedes ejecutar el arnés de pruebas de diagnóstico sin conexión contra el fixture de prueba incluido:
npm install
npm run audit-fixtureLicencia
MIT
Available Tools
5 toolsgtm_add_tag_recipeB
Adds a pre-configured tag recipe (GA4 Core, Meta Pixel, PostHog, or LinkedIn) to the container workspace.
Inputs: recipe (required), pixelId, containerPath, measurementId.
gtm_apply_consent_modeA
Configures Google Consent Mode v2 on all analytics and marketing tags (requiring ad_storage, ad_user_data, and analytics_storage).
Inputs: defaultState, containerPath.
gtm_audit_containerA
Runs a deep diagnostic audit on a Google Tag Manager container. Identifies duplicate tags, missing triggers, unconsented tracking (Consent Mode v2), and heavy blocking scripts.
Inputs: containerPath.
gtm_deduplicate_tagsA
Deduplicates GA4 configuration and Meta Pixel tags in the GTM container, consolidating firing triggers and pruning duplicate base tags.
Inputs: containerPath.
gtm_generate_datalayer_typesA
Generates production TypeScript type definitions and helper push functions for developers (E-commerce, SaaS, or Lead Gen).
Inputs: industry (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct action in the GTM workflow—audit, deduplicate, apply consent, add recipe, generate types—so an agent can usually pick the right one. Minor overlap exists where audit surfaces duplicates and consent gaps that deduplicate and apply_consent_mode then fix, but the strong action verbs keep the boundaries clear.
All tool names follow the identical `gtm_<verb>_<object>` snake_case pattern with perfect consistency. The `gtm_` prefix scopes everything to the domain, and every verb is a single lowercase action word.
Five tools is a well-scoped surface for a GTM tag-management assistant. Each tool addresses a distinct stage of the tag lifecycle—audit, cleanup, compliance, templating, and developer handoff—without feature bloat.
The core architecture workflow is well covered: audit, deduplicate, configure consent, add standard tags, and generate TypeScript datalayer helpers. Publication/preview submission and tag removal are missing, so agents may need workarounds, but the primary setup path is fully covered.
Related MCP Connectors
Hosted Google Tag Manager MCP server, with each action switched on or off per account.
Hosted MCP server for marketing analytics: plan tracking, draft GTM tags, audit tags. Free in beta
Hosted MCP server for GA4, Google Ads and Search Console. Google OAuth, nothing to install.
Hosted Google Analytics 4 MCP server, with each action switched on or off per account.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP Server that provides a conversational interface to Google Tag Manager API, allowing users to manage tags, triggers, variables, and containers through natural language.-
- AlicenseAqualityBmaintenanceMCP server for Google Tag Manager and GA4, enabling tag management, consent auditing, workspace versioning, and analytics reporting through natural language.1156 npm3MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Google Tag Manager API v2, enabling programmatic management of accounts, containers, workspaces, tags, triggers, variables, and version workflows.34 npm16MIT
- AlicenseAqualityFmaintenanceAn MCP server for the Google Tag Manager API v2 that enables AI assistants to query GTM accounts, containers, tags, triggers, variables, and unpublished changes.241Apache 2.0