gtm-tag-architect
gtm-tag-architect
Google Antigravity と Claude Code 向けの公開・本番対応プラグインで、Google Tag Manager に MCP 経由で接続します。
開発者/マーケターにサイトについてインタビューし、コンテナの欠陥(重複、欠落したトリガー、Consent Mode v2 違反)を診断し、最適化されたトラッキングタクソノミーと dataLayer 契約を生成する対話型の /setup コマンドを提供します。
機能
/setup対話型コマンド: 3 段階のインタビューと監査ワークフローをガイドします。詳細なコンテナ診断: 重複した GA4/Meta タグ、孤立したトリガー、同意のないマーケティングピクセル、レンダリングをブロックするスクリプトを監査します。
自動修復: タグの重複を排除し、すべてのタグに Google Consent Mode v2 を適用します。
業界別トラッキングマトリクス: E-Commerce、SaaS/PLG、B2B Lead Gen 向けの事前構築済みタクソノミーランブック。
開発者向け dataLayer.d.ts ジェネレーター: React、Next.js、vanilla アプリ向けの型付きイベント契約とヘルパー push 関数を生成します。
デュアルモード 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_config.json で定義された MCP サーバーを登録します。
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.
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