Run the additive migration pass from SKILL-MIGRATION-GUIDE: generate a root SKILL.md for every skill that lacked one, copied from its desktop/SKILL.md (or code/SKILL.md), with name set to the directory name and description + body preserved verbatim. - scripts/migrate_skill_root.py: the reusable, non-destructive migrator (dry-run default). - 61 new root SKILL.md (desktop source for most; code/SKILL.md for 61/62/92). - Untouched: 16/17/95 (already had root); desktop/ and code/ packaging left intact. - All 64 root SKILL.md validate: frontmatter <=1024, kebab name, description present. Still MANUAL (no SKILL.md source — commands/README only), need hand-authored root SKILL.md: 81-mac-optimizer, 90-reference-curator, 91-multi-agent-guide, 94-dintel-bootstrap. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8.3 KiB
8.3 KiB
name, description
| name | description |
|---|---|
| 62-gtm-validator | GTM QA and validation toolkit. Verifies tags fire correctly on live pages, tests trigger conditions against actual DOM, validates dataLayer schemas, checks naming conventions, compares cross-platform events, and runs QA checklists. Uses Chrome DevTools MCP for live page testing. Triggers on "validate tags", "check triggers", "verify tracking", "QA GTM", "test events", "debug GTM", "troubleshoot", "naming conventions", "GTM question", "GTM best practice", "compare versions". NOT for auditing (use gtm-audit) or creating/modifying (use gtm-editor). |
GTM Validator Skill
Verify GTM implementations work correctly on live pages. Test triggers, validate dataLayer, check naming conventions.
Available Tools
Browser Testing (Chrome DevTools MCP)
navigate_page— Load page to testevaluate_script— Check dataLayer state, test selectors, verify globalslist_network_requests— Verify tag firing after interactionsclick/hover— Simulate user actions to trigger eventslist_console_messages— Check for JS errorstake_screenshot— Document test results
GTM Container (DTM Agent MCP)
dtm_status— Check active containerdtm_list_tags/dtm_get_tag— Get tag configurationsdtm_list_triggers/dtm_get_trigger— Get trigger conditionsdtm_list_variables/dtm_get_variable— Get variable definitionsdtm_list_versions/dtm_get_live_version— Compare versions
Validation Modes
1. Tag Firing Verification
Test that specific tags fire on the correct pages and interactions.
Steps:
dtm_list_tags— get all active tags with their triggersnavigate_pageto target URLlist_network_requests— capture initial tag firings- For click triggers:
clickthe element, then checklist_network_requestsagain - Compare: expected tags (from GTM config) vs actual network requests
Verification script for specific tag:
// Check if GA4 event fired
(function(){
var dl = window.dataLayer || [];
var events = dl.filter(function(e){return e.event && e.event !== 'gtm.js' && e.event !== 'gtm.dom' && e.event !== 'gtm.load';});
return JSON.stringify(events.map(function(e){return {event: e.event, params: Object.keys(e).filter(function(k){return k !== 'event' && !k.startsWith('gtm.')})}}));
})()
2. Trigger Condition Testing
Verify trigger CSS selectors and conditions match the actual page DOM.
Steps:
dtm_get_trigger— get trigger filter/autoEventFilter- Extract CSS selectors from trigger config
evaluate_script— test if selectors match elements on page:
// Test CSS selector
(function(selector){
var els = document.querySelectorAll(selector);
return JSON.stringify({
selector: selector,
matchCount: els.length,
elements: Array.from(els).slice(0,5).map(function(el){
return {tag: el.tagName, id: el.id, classes: el.className, text: (el.textContent||'').trim().substring(0,30)};
})
});
})('.hero a.btn')
- If selector matches 0 elements → trigger will NEVER fire → CRITICAL issue
- If selector matches too many elements → trigger may fire incorrectly → WARNING
3. DataLayer Schema Validation
Verify dataLayer pushes contain required fields with correct types.
GA4 Recommended Event Schemas:
| Event | Required Fields |
|---|---|
page_view |
(automatic) |
generate_lead |
— (value, currency optional) |
purchase |
transaction_id, value, currency, items[] |
add_to_cart |
items[] (item_id, item_name, price, quantity) |
form_start |
form_id, form_name |
form_submit |
form_id, form_name |
Validation script:
// Check dataLayer for specific event schema
(function(eventName){
var dl = window.dataLayer || [];
var events = dl.filter(function(e){return e.event === eventName;});
if(events.length === 0) return JSON.stringify({found: false, event: eventName});
var e = events[events.length-1];
return JSON.stringify({found: true, event: eventName, keys: Object.keys(e), data: e});
})('generate_lead')
4. Naming Convention Check
Verify all GTM resources follow D.intelligence naming standards.
Tag naming:
[Platform] - [event_name] [context]
Examples:
GA4 - generate_lead (contact form)
sGTM - purchase
cHTML - Contact Form dataLayer Events
FB_CONVERSIONS_API-PIXEL_ID-Web-Tag-GA4_Event
Trigger naming:
[Type] - [description] Trigger
Examples:
Click - Hero CTA (consult)
CE - contact_form_submit
Form Submit - contact-form
Scroll - 50pct Depth
PV - consult booking Trigger
Variable naming:
[prefix] - [description]
Prefixes: dlv (dataLayer), cjs (Custom JS), aev (Auto-Event),
jsv (JS Variable), URL query, cookie, c (Constant)
Examples:
dlv - contact_form.request_type
cjs - Social platform
aev - click url hostname
Validation steps:
dtm_list_tags/dtm_list_triggers/dtm_list_variables- Check each name against patterns above
- Flag violations: missing prefix, wrong case, unclear description
5. Cross-Platform Event Mapping Verification
Verify the same user action sends consistent events to all platforms.
| User Action | GA4 | Meta (FB) | Google Ads | Kakao | Naver |
|---|---|---|---|---|---|
| Page view | page_view | PageView | — | pageView | — |
| Product view | view_item | ViewContent | — | viewContent | — |
| Add to cart | add_to_cart | AddToCart | — | addToCart | — |
| Purchase | purchase | Purchase | purchase | purchase | — |
| Lead form | generate_lead | Lead | submit_lead_form | participation | — |
Steps:
- Trigger a user action (click, form submit)
list_network_requests— capture all resulting requests- Check each platform received the correct event:
- GA4:
google-analytics.com/g/collect?en=... - Meta:
facebook.com/tr/?ev=... - Google Ads:
googleads.g.doubleclick.net/pagead/...
- GA4:
6. QA Checklist Execution
Run through a standard QA checklist for GTM implementation:
- GTM container snippet in
<head>(not<body>) - GTM noscript fallback in
<body> - No duplicate GTM containers on same page
- dataLayer initialized before GTM snippet
- All P1 tags fire on page load (GA4 config, Consent Mode)
- Click triggers use specific selectors (not generic classes)
- Form triggers match form IDs that exist on page
- Custom HTML tags use ES5 syntax only
- No console errors related to GTM/tags
- Consent Mode properly blocks tags before consent
- sGTM endpoint responding (no SSL errors)
- Cross-domain tracking configured if needed
7. Version Comparison
Compare tags between two container versions to identify changes.
dtm_list_versions— get version listdtm_get_live_version— get current live version with all tags- Compare tag counts, trigger counts, new/modified/deleted items
- Report changes since last publish
Reference Files
| File | Content |
|---|---|
references/datalayer-schema.md |
GA4 recommended event schemas |
references/platform-mapping.md |
GA4 ↔ Meta ↔ Kakao ↔ Ads event mapping |
references/naming-conventions.md |
Tag/trigger/variable naming rules |
references/qa-checklist.md |
Full QA checklist |
Workflow
- Receive tag list from gtm-editor (or run
dtm_list_tags) - Navigate to the target page via Chrome DevTools
- Test each trigger's CSS selector matches actual DOM elements
- Simulate user actions (clicks, form submits, scrolls)
- Capture network requests after each action
- Verify correct events fired to correct platforms
- Report pass/fail with evidence (screenshots, network logs)
Rules
- Always test on the LIVE published version, not preview (unless debugging)
- Test on both desktop and mobile viewports when possible
- Check consent mode state before flagging missing tags
- Document every test result with screenshots or network request evidence
- When a trigger uses CSS selectors instead of IDs, flag it as a fragility risk — recommend adding
idattributes to the HTML - If a trigger selector doesn't match, suggest adding an ID to the element first (not a different CSS selector) and hand off to gtm-editor
- GTM questions, best practices, and architecture advice are also in scope