/install google-tag-manager
Google Tag Manager Skill
Interact with the GTM API v2 to manage containers, workspaces, tags, triggers, variables, and versions.
Authentication
The GTM API uses OAuth2 via a Google Cloud service account.
Setup
- Enable Tag Manager API in Google Cloud Console
- Create a service account with key (JSON)
- Grant the service account access in GTM (Admin → User Management → add service account email)
- Set env vars:
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.jsonGTM_ACCOUNT_ID=123456GTM_CONTAINER_ID=789012
Script
All operations use scripts/gtm.sh. Run without args to see usage:
scripts/gtm.sh \x3Ccommand> [args...]
Commands
| Command | Description |
|---|---|
accounts |
List all GTM accounts |
containers [accountId] |
List containers in account |
workspaces |
List workspaces in container |
tags [workspaceId] |
List tags in workspace (default: latest) |
tag \x3CtagId> [workspaceId] |
Get a specific tag |
create-tag \x3CjsonFile> [workspaceId] |
Create a tag from JSON |
update-tag \x3CtagId> \x3CjsonFile> [workspaceId] |
Update a tag |
delete-tag \x3CtagId> [workspaceId] |
Delete a tag |
triggers [workspaceId] |
List triggers |
trigger \x3CtriggerId> [workspaceId] |
Get a specific trigger |
create-trigger \x3CjsonFile> [workspaceId] |
Create a trigger from JSON |
update-trigger \x3CtriggerId> \x3CjsonFile> [workspaceId] |
Update a trigger |
delete-trigger \x3CtriggerId> [workspaceId] |
Delete a trigger |
variables [workspaceId] |
List variables |
variable \x3CvariableId> [workspaceId] |
Get a specific variable |
create-variable \x3CjsonFile> [workspaceId] |
Create a variable from JSON |
update-variable \x3CvariableId> \x3CjsonFile> [workspaceId] |
Update a variable |
delete-variable \x3CvariableId> [workspaceId] |
Delete a variable |
built-in-vars [workspaceId] |
List enabled built-in variables |
enable-built-in \x3Ctype,...> [workspaceId] |
Enable built-in variable(s) |
versions |
List container version headers |
version \x3CversionId> |
Get a specific version |
version-live |
Get the live (published) version |
create-version [workspaceId] [name] [notes] |
Create version from workspace |
publish \x3CversionId> |
Publish a container version |
Workspace Resolution
Most commands accept an optional workspaceId. If omitted, the script auto-resolves to the Default Workspace (the first workspace returned by the API — typically "Default Workspace").
Common Recipes
Create a Google Ads Conversion Tag
See references/recipes.md for JSON templates for:
- Google Ads Conversion Tracking tag
- GA4 Event tag
- Custom Event trigger (dataLayer)
- Cross-domain tracking linker
Workflow: Add Tag → Create Version → Publish
# 1. Create trigger
scripts/gtm.sh create-trigger trigger.json
# 2. Create tag referencing the trigger
scripts/gtm.sh create-tag tag.json
# 3. Create version from workspace
scripts/gtm.sh create-version "" "v1.2 - Added conversion tag"
# 4. Publish
scripts/gtm.sh publish \x3CversionId>
API Reference
For full resource schemas and trigger types, see references/api-reference.md.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install google-tag-manager - 安装完成后,直接呼叫该 Skill 的名称或使用
/google-tag-manager触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Google Tag Manager 是什么?
Manage Google Tag Manager containers, tags, triggers, variables, and versions via the GTM API v2. Use when the user wants to list, create, update, delete, or... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 648 次。
如何安装 Google Tag Manager?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install google-tag-manager」即可一键安装,无需额外配置。
Google Tag Manager 是免费的吗?
是的,Google Tag Manager 完全免费(开源免费),可自由下载、安装和使用。
Google Tag Manager 支持哪些平台?
Google Tag Manager 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Google Tag Manager?
由 simonfunk(@simonfunk)开发并维护,当前版本 v1.0.0。