Glossary

Data layer

The data layer is a JavaScript array (dataLayer in Google Tag Manager) into which a website pushes events and values, such as the visitor's consent choice, so that tags and triggers can react to them.
Also calleddataLayer

A data layer separates what happens on the page from the tags that react to it. The page pushes objects like { event: "purchase", value: 49.9 } into a global array; the tag manager listens for the event name and reads the values as variables when it fires tags. Google Tag Manager's dataLayer is the best known, and Google's own gtag function pushes its commands into the same array, including the Consent Mode defaults and updates.

Consent fits this model naturally. When the visitor chooses, the consent tool pushes an event with the state of each category; triggers in the tag manager require that event with the right flag, so a Meta Pixel fires only when the marketing flag is true and an analytics tag only when the analytics flag is true. Cookiequiet pushes a cq_consent event with per-category flags (necessary, functional, analytics, marketing) that Google Tag Manager triggers can use, in addition to updating the Google Consent Mode signals directly.

The data layer is also where mistakes show. A common one is a trigger set to "All pages" for a marketing tag, which ignores consent entirely; another is pushing personal data such as email addresses into the data layer where every tag can read them. Keep consent flags and purchase values in, keep identifiers out, and check the result in preview mode and in the browser's network tab.

Put a quiet banner on your website today

Free for one website with every core feature, no card and no trial clock. Upgrade a website to Starter for $3 a month to match your brand with AI and drop the branding, or to Pro for $9 to design it with the AI agent.