The problem
Tracking rarely breaks on the day you change GTM. It breaks when a developer renames a CSS class, a CMS update changes a form, or a new checkout step stops pushing an event. Nobody notices until a weekly report looks strange, and by then days of data are gone.
I wanted a way to find out within hours, not weeks, and to know straight away which tags a change would affect.
Approach
The monitor treats a GTM container as a graph rather than a list:
- Tags depend on triggers, triggers depend on variables, and variables often read from the dataLayer or the page.
- If you know that graph, a single missing dataLayer key tells you exactly which conversions are now at risk.
What I built
- Dependency mapping. The container is read through the GTM API and turned into a map of tag → trigger → variable → source.
- Scheduled scans. A headless browser visits key pages and journeys on a schedule, records which tags fired and captures every dataLayer push.
- Diffing. Each scan is compared with the last known good one. New, missing or renamed dataLayer keys and events are flagged.
- Alerts. When something changes, the alert names the affected tags and conversions, not only the technical difference.
⚠ dataLayer change on /checkout/payment
missing key: ecommerce.transaction_id
affects: GA4 – purchase, Ads – Conversion, Meta – PurchaseWhat it changed
The biggest win is speed: a broken tag becomes a same-day fix instead of a gap in next month's report. The dependency map also helps on its own. Before editing a trigger, you can see everything that relies on it, which makes container clean-ups much less risky.
A lighter version of this check is part of my analytics audit.
Tools
- GTM API
- Node.js
- Headless browser
- Scheduled jobs
- Email / chat alerts
