Skip to content

google-tag-manager

Use when setting up Google Tag Manager, configuring data layers, managing tags and triggers, implementing server-side tagging, or configuring Consent Mode v2. Also use when debugging tag firing, managing workspaces, or integrating GTM with GA4/Meta/Pinterest.

ModelSource
sonnetpack: google-apis
Full Reference

┏━ πŸ”§ google-tag-manager ━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when setting up Google Tag Manager, config… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

GTM is a tag management system that deploys and manages measurement code without touching site source. Web container runs in the browser; sGTM runs on a server you control.

ComponentPurpose
Web ContainerClient-side tag management β€” tagmanager.google.com
Server Container (sGTM)Server-side tag processing on your infrastructure
Tag Manager API v2Programmatic container management β€” CI/CD, bulk ops
Container ID formatGTM-XXXXXXXX β€” found in GTM UI > Admin

I want to…File
Install GTM snippetreference/setup.md
Auth + service accountreference/setup.md
API endpoints (CRUD)reference/api.md
dataLayer event schemasreference/data-layer.md
Ecommerce eventsreference/data-layer.md
Consent Mode v2reference/consent.md
Tag templates (GA4, Meta, Pinterest, Clarity)reference/tags.md
Trigger patternsreference/triggers.md
Variable patternsreference/variables.md
Server-side tagging (sGTM)reference/server-side.md

FileContents
reference/setup.mdAPI overview, OAuth scopes, resource hierarchy, service account auth, container snippets (prod/staging/full template), 2025–2026 changes
reference/api.mdAll Tag Manager API v2 endpoints β€” accounts, containers, workspaces, tags, triggers, variables, built-ins, versions, folders, environments + Node.js examples
reference/data-layer.mdStandard event schema, service business events (form, phone, CTA, appointment, scroll), GA4 ecommerce event sequence
reference/consent.mdConsent Mode v2 full implementation, EEA region targeting, update flow, per-tag consent settings, behavioral modeling
reference/tags.mdGoogle Tag, GA4 Event, Meta Pixel (base + events), Pinterest Tag, Microsoft Clarity β€” JSON config templates
reference/triggers.mdAll Pages, Initialization, Custom Event, Phone Click, Form Submit, Scroll Depth, Element Visibility, History Change, YouTube
reference/variables.mdData Layer, URL, Constant, Custom JavaScript, Lookup Table, RegEx Table, Cookie, Auto-Event variables
reference/server-side.mdsGTM architecture, setup steps, client configuration, Custom Client API, event data object, consent signal forwarding

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.


SkillRelationship
ga4-apiGA4 Event tags are the most common GTM use case β€” GTM fires them
server-side-trackingGTM (web + sGTM) is the delivery mechanism for the unified tracking pipeline
microsoft-clarityDeploy Clarity via GTM Custom HTML or built-in template
tracking-foundationGTM is Phase 2 β€” installed after foundation audit, before tag deployment