gtm-tag-architect
gtm-tag-architect
Публичный, готовый к продакшену плагин для Google Antigravity и Claude Code, который подключается к Google Tag Manager через MCP.
Он предоставляет интерактивную команду /setup, которая опрашивает разработчиков/маркетологов об их сайте, диагностирует дефекты контейнера (дубликаты, отсутствующие триггеры, нарушения Consent Mode v2) и генерирует оптимизированные таксономии отслеживания и контракты dataLayer.
Возможности
Интерактивная команда
/setup: Проводит вас через 3-этапный процесс интервью и аудита.Глубокая диагностика контейнера: Аудит дублирующихся тегов GA4/Meta, осиротевших триггеров, маркетинговых пикселей без согласия и скриптов, блокирующих рендеринг.
Автоматическое исправление: Дедупликация тегов и применение Google Consent Mode v2 ко всем тегам.
Отраслевые матрицы отслеживания: Готовые руководства по таксономии для E-Commerce, SaaS/PLG и B2B Lead Gen.
Генератор
dataLayer.d.tsдля разработчиков: Генерирует типизированные контракты событий и вспомогательные push-функции для React, Next.js и обычных приложений.MCP-сервер с двумя режимами: Работает в реальном времени с Google Tag Manager REST API v2 или выполняет аудит локально экспортированных JSON-файлов контейнера в офлайн-режиме.
Related MCP server: mcp-gtm-ga4
Установка и настройка
Для Google Antigravity
Клонируйте или поместите этот репозиторий в ваше рабочее пространство или глобальный каталог пользовательских настроек:
# In your project's .agents/plugins/ or ~/.gemini/config/plugins/
git clone https://github.com/jarnielcataluna/gtm-tag-architect.gitAntigravity автоматически обнаружит плагин, предоставит команду /setup и зарегистрирует MCP-сервер, определённый в mcp_config.json.
Для Claude Code / автономного MCP
Зарегистрируйте сервер в вашем claude_desktop_config.json или в настройках MCP проекта:
{
"mcpServers": {
"gtm-tag-architect": {
"command": "node",
"args": ["/path/to/gtm-tag-architect/bin/gtm-mcp.js"]
}
}
}Использование
Запуск команды /setup
Внутри Antigravity или Claude Code:
/setupАгент задаст вам вопросы о:
Типе сайта и отрасли (E-Commerce, SaaS, Lead Gen, Content)
Необходимых пикселях (GA4, Meta, LinkedIn, Google Ads, PostHog)
Требованиях к конфиденциальности (GDPR / Consent Mode v2)
Затем он выполняет диагностический аудит и предоставляет вам меню действий для исправления дефектов, применения правил согласия или экспорта чистого dataLayer.d.ts.
Тестирование и локальный аудит
Вы можете запустить офлайн-тестовый диагностический набор против включённого тестового фикстура:
npm install
npm run audit-fixtureЛицензия
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.
Maintenance
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.1157 npm3MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Google Tag Manager API v2, enabling programmatic management of accounts, containers, workspaces, tags, triggers, variables, and version workflows.46 npm15MIT
- 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.2413 PyPI1Apache 2.0