Skip to content
Tag Manager Training
GTM & GA4 glossary

GTM glossary

Data layer

A JavaScript object on your website that holds information for Google Tag Manager to read, such as form submissions, user details or purchase data.

Also known as: dataLayer, Datalayer

On this page
  1. In plain English
  2. Example
  3. Official documentation
  4. Related terms

In plain English

Think of the data layer as a noticeboard between your website and GTM. The website posts messages to it; GTM reads them and uses them in triggers and tags.

It's more reliable than scraping values off the page (like reading the text of a button), because it doesn't break when someone redesigns the site.

Developers add information with dataLayer.push(). If the message includes an event key, GTM can fire a custom event trigger at that moment.

Example

When someone submits the enquiry form, the website runs:

window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  event: 'generate_lead',
  form_name: 'contact'
});

In GTM, a custom event trigger listens for generate_lead, and a data layer variable reads form_name.

Official documentation

Last reviewed

Next step

Want your team to know this without looking it up?

Hands-on Google Tag Manager and GA4 training for agencies and marketing teams in Brisbane, the Gold Coast and the Sunshine Coast.