All articles

How to check your dataLayer in five minutes

A quick routine, using only your browser, to see whether your site is sending the data your tags depend on.

Naini Anjaneyulu, 2 December 2026

Most tracking problems are not GA4 problems. They are dataLayer problems: the website stopped sending something, sent it under a new name, or sent it at the wrong moment. The good news is that you can check this yourself in about five minutes, with nothing but a browser.

What the dataLayer is, in one paragraph

The dataLayer is a JavaScript array on your page. Your website pushes small objects into it ("a user viewed this product", "this form was submitted") and Google Tag Manager listens to those pushes to decide which tags to fire and what values to send. If the pushes are wrong, every tool downstream is wrong too, no matter how well GTM is configured.

Minute 1: look at it

Open the page you care about, open the browser developer tools (F12, or right-click → Inspect) and go to the Console tab. Type:

dataLayer

Press Enter and expand the array. You will see every object pushed so far, in order. If you get dataLayer is not defined, GTM is either missing from the page or uses a renamed dataLayer, which is worth knowing straight away.

Minute 2: check the page-level data

The first few pushes usually describe the page: page type, language, logged-in state, content group. Ask two questions:

  • Is everything there? Compare against your tracking plan (or, if you don't have one, against what your reports filter by).
  • Is it pushed before GTM needs it? If page type arrives after the gtm.js event, tags that fire on page load won't see it.

Minute 3: trigger the important action

Now do the thing that matters to the business: add to cart, submit the lead form, start a sign-up. Then type dataLayer again and look at the newest entries. A healthy push looks something like this:

{
  event: "generate_lead",
  form_id: "contact-main",
  form_location: "footer"
}

Check the event name exactly, including capital letters and underscores. generate_lead and Generate_Lead are two different events to GTM.

Minute 4: watch it live with Preview mode

Open GTM, click Preview and enter your site's address. Repeat the action. In the Tag Assistant panel, click the event on the left and check two tabs:

  • Tags: did the tags you expect fire on this event, and not on others?
  • Data Layer: the values GTM actually read. If a variable shows undefined, the key name in GTM and the key name on the site don't match.

Minute 5: write down what you found

Keep a simple table. It turns a vague "tracking seems off" into a list a developer can fix:

Page / actionExpectedActualStatus
Contact form submitgenerate_leadform_submitRenamed
Product pageitem_id presentMissingBroken
Checkoutbegin_checkoutbegin_checkoutOK

The four things I find most often

  1. Renamed events after a redesign, so the trigger in GTM no longer matches.
  2. Events that fire twice because a single-page app pushes on every route change and on page load.
  3. Values as text instead of numbers, for example "1,299" instead of 1299, which breaks revenue reports.
  4. Old ecommerce objects not cleared, so one product's data leaks into the next event. Push { ecommerce: null } before each new ecommerce event.
Make it a habitRun this check after every site release that touches templates, forms or checkout. Five minutes after a deploy is far cheaper than a month of missing conversions.

If your check turns up more questions than answers, an analytics audit goes through the whole setup and ends with a prioritised fix list.

Can you trust your data?

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

Start a project