The dataLayer is a JavaScript array on window that GTM and gtag.js use to receive structured data from the page. Pages push events and variables onto it via dataLayer.push({...}), and GTM listens for those pushes to fire matching tags and triggers.
The standard ecommerce dataLayer in GTM uses an ecommerce object containing an items array, where each item describes a product with fields like item_id, item_name, price, and quantity. The full object also includes a currency field and event-specific fields like value for purchases or transaction_id for orders.
A container is the top-level workspace in GTM that holds all your tags, triggers, and variables for a single property. It compiles to a snippet you place on your site, and every published version is versioned so you can roll back changes without redeploying code.
A GTM template is a reusable definition of a custom tag or variable, packaged with its UI, permissions, and sandboxed JavaScript. Built-in templates cover most major vendors, and you can import community templates from the Template Gallery or build your own for proprietary integrations.
Meta server-side tracking sends conversion events directly from your server to Meta's Conversions API, bypassing the browser-side Pixel entirely. The standard implementation uses server-side GTM as the relay: the client container forwards events to your sGTM endpoint, which transforms and forwards them to Meta with hashed user data.
Publishing a container takes the current workspace, creates a versioned snapshot, and pushes it live to every page running the GTM snippet. From the workspace overview, click Submit, name the version, click Publish, and the new version reaches end users within seconds.
Server-side GTM is a second container that runs on a server you control, receiving events from your client-side container and forwarding them to vendors like GA4, Meta, or Google Ads. It moves network requests off the user's browser, which improves page performance, hides third-party endpoints from ad blockers, and lets you enrich or filter data before it leaves your infrastructure.
Calendly broadcasts a postMessage event when a visitor completes a booking, which you listen for using window.addEventListener and filter by the calendly.event_scheduled type. From there you push the event to the dataLayer and trigger a GA4 or Google Ads conversion in GTM.
Gravity Forms fires a jQuery gform_confirmation_loaded event after a successful submission, which you hook into with a small JavaScript snippet that pushes a form_submit event to the dataLayer. A GTM custom event trigger then routes the conversion to GA4, Google Ads, or any other destination.
HubSpot Forms V4 emits an hs-form-event:on-submission:success custom event on the document, exposing the form ID and submission data through the HubSpotFormsV4 instance API. You listen for the event in GTM via a custom HTML tag, push a form_submit event to the dataLayer, and forward it to GA4 with the form ID as a parameter.
Typeform doesn't push to the dataLayer natively, so you embed the form via the Typeform Embed SDK and listen for its form-submit event in JavaScript. From there you push a custom event to the dataLayer, which a GTM custom event trigger picks up and forwards to GA4 or Google Ads.