Expert guidance for Google Tag Manager REST API v2 including authentication, programmatic container management, automation scripts, bulk operations, and GTM configuration backup/export. Use when automating GTM operations, managing multiple containers, building GTM tools, syncing configurations, exporting GTM data programmatically, working with Python or Node.js GTM automation, or using service account JSON credentials. Requires google-api-python-client and google-auth packages for Python implementations.
/plugin marketplace add henkisdabro/wookstar-claude-code-plugins/plugin install gtm-suite@wookstar-claude-code-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/api-overview.mdThis skill provides comprehensive expertise for the Google Tag Manager REST API v2, enabling programmatic management of GTM containers, tags, triggers, variables, and configurations.
Invoke this skill when:
Use OAuth 2.0 with service accounts (recommended for automation):
from google.oauth2 import service_account
from googleapiclient.discovery import build
SCOPES = ['https://www.googleapis.com/auth/tagmanager.edit.containers']
SERVICE_ACCOUNT_FILE = 'service-account-key.json'
credentials = service_account.Credentials.from_service_account_file(
SERVICE_ACCOUNT_FILE, scopes=SCOPES)
service = build('tagmanager', 'v2', credentials=credentials)
Account → Container → Workspace → Tags/Triggers/Variables
List Containers:
containers = service.accounts().containers().list(
parent='accounts/123456'
).execute()
Create Tag:
tag_body = {
'name': 'GA4 Event',
'type': 'gaawe',
'parameter': [
{'key': 'eventName', 'value': 'click', 'type': 'template'}
],
'firingTriggerId': ['trigger_id']
}
service.accounts().containers().workspaces().tags().create(
parent=workspace_path, body=tag_body
).execute()
Publish Version:
version = service.accounts().containers().workspaces().create_version(
path=workspace_path,
body={'name': 'API Version', 'description': 'Auto-deployed'}
).execute()
service.accounts().containers().versions().publish(
path=version['containerVersion']['path']
).execute()
def backup_container(workspace_path, output_file):
tags = service.accounts().containers().workspaces().tags().list(
parent=workspace_path
).execute()
triggers = service.accounts().containers().workspaces().triggers().list(
parent=workspace_path
).execute()
variables = service.accounts().containers().workspaces().variables().list(
parent=workspace_path
).execute()
with open(output_file, 'w') as f:
json.dump({
'tags': tags.get('tag', []),
'triggers': triggers.get('trigger', []),
'variables': variables.get('variable', [])
}, f, indent=2)
def disable_all_tags(workspace_path):
tags = service.accounts().containers().workspaces().tags().list(
parent=workspace_path
).execute()
for tag in tags.get('tag', []):
tag['paused'] = True
service.accounts().containers().workspaces().tags().update(
path=tag['path'], body=tag
).execute()
from googleapiclient.errors import HttpError
try:
tag = service.accounts().containers().workspaces().tags().create(
parent=workspace_path, body=tag_body
).execute()
except HttpError as error:
if error.resp.status == 404:
print("Resource not found")
elif error.resp.status == 403:
print("Permission denied")
Install: pip install google-api-python-client google-auth-oauthlib
List: .list(parent=parent_path)
Get: .get(path=resource_path)
Create: .create(parent=parent_path, body=resource_body)
Update: .update(path=resource_path, body=resource_body)
Publish: .create_version() then .publish()
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.