gtm-testing

Automate Google Tag Manager testing with Playwright and GA4 DebugView validation.

3|1|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/aimonk2025/google-tag-manager-automation --skill gtm-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gtm-testing
Source: https://github.com/aimonk2025/google-tag-manager-automation/tree/main/skills/gtm-testing
Command: npx skills add https://github.com/aimonk2025/google-tag-manager-automation --skill gtm-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates GTM testing and validation to ensure dataLayer events are emitted correctly and GTM configurations fire as intended, reducing manual testing effort and accelerating quality assurance across projects.

Core Features & Use Cases

  • Tiered validation approach combining automated Playwright tests (Tier 0), browser console verification (Tier 1), GTM Preview mode checks (Tier 2), and GA4 DebugView validation (Tier 3).
  • Optional business context loading via a gtm-context.md file to tailor validation focus to site type and known gaps.
  • Clear-test scaffolding including a reusable captureDataLayerEvents helper, guidance for element selectors, and a ready-to-run test script (scripts/test-tracking.js) that reports PASS/FAIL/WARN and supports expansion.

Quick Start

Run the automated test script to validate GTM tracking end-to-end and review PASS/FAIL/WARN results.

Frequently Asked Questions about gtm-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Google Tag Manager testing for dataLayer events?

Automating GTM validation uses a tiered approach: Tier 0 runs automated Playwright tests for dataLayer events, Tier 1 checks browser console logs, Tier 2 verifies GTM Preview mode, and Tier 3 validates GA4 DebugView for end-to-end coverage.

Can I validate GA4 integration and GTM firing using Playwright?

Playwright validates GA4 and GTM by capturing dataLayer events through a reusable helper and executing test scripts that output PASS, FAIL, or WARN results, confirming that your tags fire as intended across user interactions.

What is the best way to verify dataLayer events are emitted correctly?

Verifying dataLayer events involves using a captureDataLayerEvents helper within Playwright tests to intercept event pushes, then cross-referencing the captured data against GTM Preview mode and GA4 DebugView for comprehensive validation.

Do I need a specific project setup to run automated GTM validation?

Your project must use Google Tag Manager with dataLayer events and GA4 integration, and have Playwright installed for automated testing; optionally, a gtm-context.md file can be added to tailor validation focus to your site type.

Why are my GTM tags not firing during automated Playwright tests?

GTM tags may fail to fire during Playwright tests if element selectors are incorrect, dataLayer events are pushed before the capture helper initializes, or if Tier 1 console checks and Tier 2 GTM Preview mode reveal configuration gaps in tag triggers.