What is a dataLayer event?

A dataLayer event is an important part of Web analytics and digital marketing. It is a specific way to collect information about user actions on a Web site and pass it to analytics tools such as Google Analytics or Google Tag Manager.

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.

What exactly is an event?

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:

  • Name of product purchased
  • Product price
  • Category in which the product falls
  • Time of purchase
  • Unique customer code

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.

The difference between dataLayer push and dataLayer event push

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.

Back to

Most common questions

What events should I track for my type of website?
How can I tell if my dataLayer events are working correctly?
Can I set up dataLayer events myself without a developer?
What happens if my dataLayer events don't work?