| name | google-tagmanager |
| description | Comprehensive Google Tag Manager guide covering container setup, tags, triggers, variables, data layer, debugging, custom templates, and API automation. Use when working with GTM implementation, configuration, dataLayer push design, custom tag/template building, server-side container setup, GTM API automation, optimisation, or troubleshooting. Do NOT use for direct gtag.js/GA4 setup that bypasses GTM (use the google-analytics skill), Adobe Launch, Tealium, or other non-GTM tag management systems. |
Google Tag Manager
Overview
Expertise for Google Tag Manager (GTM) covering container setup, tag configuration, triggers, variables, data layer implementation, debugging, custom templates, and API automation. See the reference files below for detailed guidance on each topic.
When to Use This Skill
Invoke when setting up or configuring GTM containers, tags, triggers, or variables; implementing the data layer; debugging with Preview mode or Tag Assistant; building custom templates; automating via the REST API; or optimising container performance and consent management.
Quick Start
- Create a GTM account at tagmanager.google.com
- Create a container (Web, iOS, Android, or Server)
- Install the container snippet - see setup.md
- Configure tags, triggers, and variables
- Test in Preview mode - see debugging.md
- Publish
Basic Tag Configuration
Example: Google Tag (GA4)
Tag Type: Google Tag
Tag ID: G-XXXXXXXXXX
Trigger: All Pages
See tags.md for comprehensive tag documentation.
Data Layer Push
window.dataLayer = window. || [];
dataLayer.({
: ,
: ,
: ,
:
});