Containers, tags, triggers, variables
The main benefit is independence: marketing can add a conversion or a pixel in minutes, without waiting for a site release.
- Container: the bundle of tags, triggers and variables installed on a website or app.
- Tag: the script to run, such as a GA4 event or a Google Ads conversion.
- Trigger: the condition that fires the tag, such as a click, a page view or a form submission.
- Variable: a reusable value such as the page URL, the clicked button text or an order total.
The data layer
The data layer (dataLayer) is a JavaScript object where the site places information that GTM then passes to tags. Instead of scraping an amount from the page text, which breaks at the next redesign, the site sends a structured value, for example dataLayer.push({'event': 'generate_lead', 'form_name': 'quote'}).
It is the most robust method for important data: order values, form type, product IDs. A developer implements it once, and every tag can use it from then on.
Best practices
Once a quarter, audit the container: pause tags for tools you no longer pay for, check that every trigger still matches the current site, and export a backup of the workspace.
- Test every change in Preview mode before publishing.
- Name and describe each published version so you can roll back.
- Use a naming convention: tool, type, detail (GA4, event, phone click).
- Limit publishing rights to two or three people.
- Never install GA4 both hard-coded on the site and through GTM, which doubles data.
- Connect Consent Mode and your banner so tags respect opt-outs and EU consent.
