What is the data layer?

Google Tag Manager (GTM) Relies on a global array (window.dataLayer) to push event objects to and process them from. GTM listens to this array for events and reacts to each event. For example, after an add to cart event on a website a snapshot of the data layer may look as follows...

window.dataLayer = [
	{ event: "gtm.dom", ... }, // user loads a page
	{ event: "dl_view_item",  ... }, // user views a product
	{ event: "dl_add_to_cart",  ... }, //	user adds a product

// Pushing a new event into the data layer
window.dataLayer.push({ event: "dl_remove_from_cart", ... });

Special Properties and Utilities

Route Changes

Data Layer Events

Some of these events are automatically pushed to the data layer by GTM. What you’ll need to implement and push into the data layer at the correct times are the following events:

Base Event

Account Management Events

Ecommerce Funnel Events