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 inspect GTM tags, triggers, variables, built-in variables, workspaces, or versions. Also use for publishing container versions, auditing GTM setups, creating conversion tags, setting up cross-domain tracking, or managing dataLayer events. Covers: "GTM", "Tag Manager", "container tag", "conversion tag", "trigger", "GTM variable", "publish GTM", "GTM workspace", "dataLayer", "Google Ads tag", "GA4 tag", "cross-domain tracking".
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- google-tag-manager
- metadata
- { "env": [ { "GTM_ACCOUNT_ID": "GTM account ID (numeric). Find at tagmanager.google.com." }, { "GTM_CONTAINER_ID": "GTM container ID (numeric)." }, { "GOOGLE_APPLICATION_CREDENTIALS": "Path to service account JSON key file with Tag Manager API access." } ] }
- description
- 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 inspect GTM tags, triggers, variables, built-in variables, workspaces, or versions. Also use for publishing container versions, auditing GTM setups, creating conversion tags, setting up cross-domain tracking, or managing dataLayer events. Covers: "GTM", "Tag Manager", "container tag", "conversion tag", "trigger", "GTM variable", "publish GTM", "GTM workspace", "dataLayer", "Google Ads tag", "GA4 tag", "cross-domain tracking".
03 SKILL.md 正文
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 <command> [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 <tagId> [workspaceId] |
Get a specific tag |
create-tag <jsonFile> [workspaceId] |
Create a tag from JSON |
update-tag <tagId> <jsonFile> [workspaceId] |
Update a tag |
delete-tag <tagId> [workspaceId] |
Delete a tag |
triggers [workspaceId] |
List triggers |
trigger <triggerId> [workspaceId] |
Get a specific trigger |
create-trigger <jsonFile> [workspaceId] |
Create a trigger from JSON |
update-trigger <triggerId> <jsonFile> [workspaceId] |
Update a trigger |
delete-trigger <triggerId> [workspaceId] |
Delete a trigger |
variables [workspaceId] |
List variables |
variable <variableId> [workspaceId] |
Get a specific variable |
create-variable <jsonFile> [workspaceId] |
Create a variable from JSON |
update-variable <variableId> <jsonFile> [workspaceId] |
Update a variable |
delete-variable <variableId> [workspaceId] |
Delete a variable |
built-in-vars [workspaceId] |
List enabled built-in variables |
enable-built-in <type,...> [workspaceId] |
Enable built-in variable(s) |
versions |
List container version headers |
version <versionId> |
Get a specific version |
version-live |
Get the live (published) version |
create-version [workspaceId] [name] [notes] |
Create version from workspace |
publish <versionId> |
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 <versionId>
API Reference
For full resource schemas and trigger types, see references/api-reference.md.
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.