The dataLayer is a digital container that stores information about what happens on your website in your visitor's browser and session. Think of it as a log that keeps track of all important events. When a visitor does something on the website, such as view a product, fill out a form or make a purchase, that action is recorded as an event in the dataLayer.
An event is a specific event that occurs on your website. It can be anything: clicking a button, playing a video, downloading a file, completing a login or leaving the website. Each event usually contains several pieces of information, such as what happened, when it happened and who did it. Imagine someone buys a product from your Web shop. The dataLayer event could then contain information such as:
This information is collected automatically and can later be used to create reports on website visitor behavior.
DataLayer events are valuable because they provide detailed insights into how people are using your Web site. With this information you can discover, for example, which products are most popular, on which pages visitors click away, or which marketing campaigns work best. For web shops, it is particularly interesting to keep track of which products are frequently viewed but not purchased. This information helps optimize the website and improve the user experience.
There is an important difference between a regular dataLayer push and a dataLayer event push. A regular dataLayer push only adds information to the dataLayer, such as product data or customer information. This push does not contain a specific event and therefore cannot be used to trigger actions in Google Tag Manager. A dataLayer event push, on the other hand, always contains an event parameter. This parameter indicates that something specific happened on the website. Only with an event push can Google Tag Manager respond and, for example, record a conversion or forward data to Analytics.
Practical example of an ordinary push:
dataLayer.push({'productName': 'Rode sneakers', 'price': 89.99})
Example of an event push:
dataLayer.push({'event': 'purchase', 'productName': 'Rode sneakers', 'price': 89.99})
Only the second version can activate a trigger in Google Tag Manager.
For Web shops, the most important events are product view, add to cart, start checkout process, completed purchase and remove from cart. Searches and wishlist additions are also valuable. For service providers, focus on contact form completions, brochure downloads, phone number clicks, quote requests and newsletter signups. For consulting, white paper downloads and webinar signups are of interest. Content websites primarily track: article reads (scroll depth), video plays, comments posted, social media shares and time on page. Internal searches also provide insight into what visitors are looking for. For all websites, basic events are useful such as exit links, file downloads, 404 errors and scroll depth.
The easiest way is to use Google Tag Manager Preview Mode. This tool shows you in real time what events are triggered when you perform actions on your website. You can see exactly what information is passed through. Google Analytics 4 has a DebugView in which events appear immediately. This allows you to check if events arrive correctly in Analytics. Realtime reports also show recent events. Browser development tools are useful for technical verification. In the Console tab you will see dataLayer pushes appear. Extensions like Google Tag Assistant or dataLayer Checker Helper make debugging even easier. Always test different scenarios: different browsers, mobile and desktop, and all major user actions. Document what events you expect with each action so you can check systematically.
For standard websites, technical knowledge is usually required because you have to add code to the website. This requires access to website files and an understanding of HTML and JavaScript. For Shopify, WooCommerce, Magento and Lightspeed web shops, however, there is a practical solution. AdPage can handle this implementation completely for you. They have experience with these platforms and can set up DataLayer events professionally without the need for your own technical knowledge.
Common problems include typos in event names, incorrect syntax in the dataLayer push code, or events that are triggered before Google Tag Manager is loaded. Missing triggers in Tag Manager also cause problems. Timing issues are common. Events that are triggered too early before tracking scripts load are lost. You solve this by delaying events or checking if scripts are loaded. Wrong variable names or data structure cause information not to be sent correctly to Analytics. Always check that the variable names in Tag Manager match the dataLayer.