How do you read a dataLayer?

Reading a dataLayer is essential for Web analysts and marketers who want to understand user behavior and control a tracking setup. As a marketer or web administrator, you want to know what data is available in the dataLayer to set up and fine-tune your tracking setup.
Looking for tracking with a comprehensive eCommerce dataLayer?
Or

The dataLayer works as an intermediate layer between your Web site and analytics tools. It is an array of objects containing relevant data such as pages visited, products viewed, transactions and user actions. Each entry usually contains an event property that indicates what happened, such as "page_view," "click," or "purchase.

GTM Preview Mode: the best method

Google Tag Manager Preview Mode is by far the most effective way to read dataLayer events. Activate this mode by going to "Preview" in GTM and entering your website URL. A new tab will open with your website, plus a debug window at the bottom. In this debug window, you will see all dataLayer pushes appear in real time. Each time an event is triggered, such as a page visit or click, it immediately appears in the timeline. You can click on each event to see the full dataLayer content, including all variables and their values. The big advantage of GTM Preview Mode is that you can see exactly which tags are fired on each event. You can verify that your tracking is working correctly and that all necessary data is being sent. The window also shows which triggers are active and which tags were successfully executed.

Alternative methods

In addition to GTM Preview Mode, you can use the browser console. Open the console in your browser (via element inspect) and type dataLayer to see the full content. For a structured view, use console.table(dataLayer). Specific events can be filtered with dataLayer.filter(item => item.event === 'purchase'). Browser extensions such as "dataLayer Checker" also provide a user-friendly interface for viewing dataLayer content without technical knowledge.

Troubleshooting

Common problems include missing events, duplicate records or incorrect data formats. GTM Preview Mode helps identify these problems quickly. Verify that the dataLayer is initialized correctly and that events are named consistently. Pay particular attention to the timing of events. Some events may be triggered too early or too late, which you can easily see in the GTM Preview timeline. This helps optimize your tracking implementation and ensures reliable data collection.

Back to
What is a dataLayer?

Most common questions

How can you tell if a dataLayer event was successfully sent to Google Analytics?
Which dataLayer events are most important to monitor?
How often should you check dataLayer events?
How do you filter for specific events or users in GTM Preview Mode?