All work

GTM health monitor

A monitoring tool that maps tag and trigger dependencies in Google Tag Manager, scans on a schedule and alerts when the dataLayer changes.

Type
Internal tool
Runs
On a schedule
Watches
Tags, triggers, dataLayer
Output
Alerts + dependency map

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

  1. Dependency mapping. The container is read through the GTM API and turned into a map of tag → trigger → variable → source.
  2. Scheduled scans. A headless browser visits key pages and journeys on a schedule, records which tags fired and captures every dataLayer push.
  3. Diffing. Each scan is compared with the last known good one. New, missing or renamed dataLayer keys and events are flagged.
  4. 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 – Purchase

What 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

Can you trust your data?

Tell me what you track, and what you ask visitors before you track it.

Start a project