← Run an audit
Home / Checks / 4 of 11
high severity

Tag Manager is in place

GTM lets you change tags without a developer. It also creates its own failure mode: installed but unused, or firing twice.

Why this matters

GTM lets you change tags without a developer. It also creates its own failure mode: installed but unused, or firing twice.

How this tool detects it

The tool looks for a container ID (GTM- prefix) and the URL that loads it. A container ID being present counts as deployed.

It then checks whether dataLayer is initialised, recognising four common forms: window.dataLayer=window.dataLayer||[], window['dataLayer']=…, the GTM inline snippet, and a gtag('js') call.

Both need to be present for the setup to be healthy. A container without dataLayer is a common and quiet half-finished state: the container loads, but triggers read no variables, so tags fire in ways you did not design.

Where this check can mislead you

Static analysis has limits. These are the cases where this particular check will report a result that does not match reality — worth knowing before you act on it.

Examples

CorrectCorrect: GTM and dataLayer both present
<script>window.dataLayer=window.dataLayer||[];</script>
<script async src="https://www.googletagmanager.com/gtm.js?id=GTM-ABC123"></script>

dataLayer must be declared before the GTM container script.

WrongWrong: GTM is present but dataLayer is not
<script async src="https://www.googletagmanager.com/gtm.js?id=GTM-ABC123"></script>

Triggers cannot read variables such as form fields, so they can only fire on default events like a pageview.

How to fix it

  1. Put window.dataLayer=window.dataLayer||[]; at the top of <body> or inside <head>, before the GTM container.
  2. If there is no <noscript> version, add it — without it, users with JavaScript disabled are counted for nothing at all.
  3. In GTM Preview, confirm your triggers fire when you expect them to.
  4. While you are in there, check how many tags the container actually holds. An empty container usually means the migration never got configured — GTM was installed and nothing else.

Verify it worked

After making changes, confirm delivery rather than assuming. These steps require your Google login, which is exactly why this tool stops short of them.

Related checks

One thing static analysis cannot tell you: this page reads published code, so it shows what is installed, never what actually fires. To confirm delivery, use GTM Preview and GA4 DebugView — both require your Google login.

Check whether your site has this problem — no login required.