Agent skill

google-tagmanager

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, optimisation, troubleshooting, or any GTM-related tasks.

Stars 46
Forks 8

Install this agent skill to your Project

npx add-skill https://github.com/henkisdabro/wookstar-claude-plugins/tree/main/plugins/google-tagmanager/skills/google-tagmanager

SKILL.md

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

  1. Create a GTM account at tagmanager.google.com
  2. Create a container (Web, iOS, Android, or Server)
  3. Install the container snippet - see setup.md
  4. Configure tags, triggers, and variables
  5. Test in Preview mode - see debugging.md
  6. Publish

Basic Tag Configuration

javascript
// Example: GA4 Configuration Tag
Tag Type: Google Analytics: GA4 Configuration
Measurement ID: G-XXXXXXXXXX
Trigger: All Pages

See tags.md for comprehensive tag documentation.

Data Layer Push

javascript
window.dataLayer = window.dataLayer || [];
dataLayer.push({
  'event': 'custom_event',
  'category': 'engagement',
  'action': 'button_click',
  'label': 'CTA Button'
});

See datalayer.md for data layer patterns.

Core Concepts

Tags are snippets of code that execute on your site (e.g., GA4, Google Ads, Facebook Pixel).

Triggers define when tags fire (e.g., page views, clicks, form submissions).

Variables capture dynamic values for use in tags and triggers (e.g., page URL, click text, data layer values).

User Action --> Trigger Fires --> Tag Executes --> Data Sent
     ^                                    |
     |                                    v
     +--- Variables provide values -------+

Common Workflows

GA4 Page View Tracking

  1. Create GA4 Configuration tag with Measurement ID
  2. Set trigger to "All Pages"
  3. Test in Preview mode, verify in GA4 DebugView
  4. Publish

Form Submission Tracking

  1. Create Form Submission trigger
  2. Create GA4 Event tag (form_submit) with form ID/name as parameter
  3. Test in Preview mode and publish

E-commerce Tracking

  1. Implement data layer with e-commerce events - see datalayer.md
  2. Create data layer variables and GA4 Event tags for each event
  3. Map variables to event parameters
  4. Test complete purchase flow and publish

Debug Tag Not Firing

  1. Enable Preview mode and perform the action
  2. Check "Tags Not Fired" section and review trigger conditions
  3. Verify data layer values, fix conditions, and retest
  4. See debugging.md for detailed workflows

Technical Constraints

ES5 Required: Custom JavaScript Variables and Custom HTML Tags must use ES5 syntax (var, function(), string concatenation). Custom Templates support some ES6. See best-practices.md for details and workarounds.

RE2 Regex: GTM uses RE2 regex - no lookahead, lookbehind, or backreferences. See best-practices.md for supported patterns.

Quick Reference

Built-in Variables to Enable

  • Page URL, Page Path, Page Hostname
  • Click Element, Click Classes, Click ID, Click URL, Click Text
  • Form Element, Form ID, Form Classes
  • Scroll Depth Threshold, Scroll Direction

Common Trigger Types

Page View, Click (All Elements / Just Links), Form Submission, Custom Event, History Change (SPAs), Timer, Scroll Depth

Essential Data Layer Events

javascript
// Page view
dataLayer.push({ 'event': 'page_view' });

// User login
dataLayer.push({ 'event': 'login', 'method': 'Google' });

// Purchase
dataLayer.push({
  'event': 'purchase',
  'ecommerce': {
    'transaction_id': 'T12345',
    'value': 99.99,
    'currency': 'AUD',
    'items': [...]
  }
});

Reference Files

Topic Reference File
Container setup setup.md
Tag configuration tags.md
Trigger configuration triggers.md
Variable configuration variables.md
Data layer datalayer.md
Debugging debugging.md
Best practices, naming, performance, security best-practices.md
Custom templates custom-templates.md
API automation api.md

External Resources

Expand your agent's capabilities with these related and highly-rated skills.

henkisdabro/wookstar-claude-plugins

tampermonkey

Write Tampermonkey userscripts for browser automation, page modification, and web enhancement. Use when creating browser scripts, writing greasemonkey scripts, automating user interactions, injecting CSS or JavaScript into web pages, modifying website behaviour, building browser extensions, hiding unwanted page elements, adding form auto-fill, scraping website data, intercepting requests, detecting URL changes in SPAs, or storing persistent user preferences. Covers userscript headers (@match, @grant, @require), synchronous and async GM_* API functions, common patterns (DOM mutation, URL change detection, element waiting), security sandboxing, and cross-browser compatibility (Chrome, Firefox, Edge).

46 8
Explore
henkisdabro/wookstar-claude-plugins

google-analytics

Comprehensive Google Analytics 4 guide covering property setup, events, custom events, recommended events, custom dimensions, user tracking, audiences, reporting, BigQuery integration, gtag.js implementation, GTM integration, Measurement Protocol, DebugView, privacy compliance, and data management. Use when working with GA4 implementation, tracking, analysis, or any GA4-related tasks.

46 8
Explore
henkisdabro/wookstar-claude-plugins

pdf-processing-pro

Production-ready PDF processing with forms, tables, OCR, validation, and batch operations. Use when working with complex PDF workflows in production environments, processing large volumes of PDFs, or requiring robust error handling and validation. Do NOT use for simple text extraction - use pdf-extract for quick reads.

46 8
Explore
henkisdabro/wookstar-claude-plugins

docx

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. Use when working with professional documents (.docx files) for creating new documents, modifying or editing content, working with tracked changes, adding comments, or any other document tasks. Do NOT use for creating proposals, letters, or client-facing business documents from scratch - use document-builder for those.

46 8
Explore
henkisdabro/wookstar-claude-plugins

xlsx

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualisation. Use when working with spreadsheets (.xlsx, .xlsm, .csv, .tsv) for creating new spreadsheets with formulas and formatting, reading or analysing data, modifying existing spreadsheets while preserving formulas, data analysis and visualisation, or recalculating formulas.

46 8
Explore
henkisdabro/wookstar-claude-plugins

prp-generator

Generate comprehensive Product Requirement Plans (PRPs) for feature implementation with thorough codebase analysis and external research. Use when the user requests a PRP, PRD, or detailed implementation plan for a new feature. Conducts systematic research, identifies patterns, and creates executable validation gates for one-pass implementation success. Do NOT use for client discovery, requirements gathering, or scope definition - use scope-clarifier for those.

46 8
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results