Lesson 1 of 8
What Is Google Tag Manager?
Google Tag Manager (GTM) is a free tool that lets you add and manage tracking on your site without editing code every time. You add one GTM snippet to your pages, your containerContainerThe GTM workspace you install once; it holds all your tags, triggers and variables for a site or app. (the GTM-XXXXXXX id you paste into these lessons), and from then on you manage everything inside the GTMGTMGoogle Tag Manager: a free tool for managing tracking tags without touching site code for every change. interface and publish changes with a click.
Before GTM, every new pixel or analytics tag meant a developer ticket and a code deploy, and your site's <head> slowly filled with one-off scripts. With a container in place, marketers and analysts can add a Google Ads conversion, a Meta Pixel, or a GA4GA4Google Analytics 4: Google's current analytics platform, event-based and built for cross-device measurement. event themselves, safely, with Preview modePreview modeGTM's safe testing mode that lets you verify tag behavior on a live page before publishing a new version. and full version history to roll back if something breaks.
The building blocks
A container is built from three kinds of object, all fed by the dataLayerdataLayerA JavaScript array your site pushes structured data into, which GTM listens to and acts on., the stream of information your site sends in:
- TagsTagA piece of code GTM injects and runs; it sends data to GA4, Google Ads, Meta, and so on., the snippets of code that actually run, a GA4 event, an ad pixel, your own HTML.
- TriggersTriggerThe rule that decides when a tag fires, like a page view, a link click, or a custom dataLayer event., the rules that decide when each tag fires.
- VariablesVariableA reusable value such as a page URL, a dataLayer key, or a cookie, referenced inside tags and trigger conditions., reusable values that feed your tags and triggers.
- dataLayer, the structured data your site hands to GTM to act on.
How the pieces combine
They are not independent, they snap together. A tag never runs on its own: a trigger tells it when, and variables supply the values it sends. So "fire a GA4 purchase tag when the dataLayer pushes a purchase event, and send the order value from a variable" is one tag, one trigger, and one variable working together. Nearly everything in the hands-on courses is a remix of that.
Around those objects, GTM adds folders and workspaces to stay organized, versions so every publish is reversible, and a built-in Preview mode (Tag AssistantTag AssistantGTM's built-in debugger: shows exactly which tags fired on each event, and with what data.) for safe testing before anything goes live.
Key takeaway
GTM is a container you install once. Inside it, tags, triggers and variables, fed by the dataLayer, combine to do all your tracking, with no code deploy for each change.