What are tags, triggers and variables in Google Tag Manager?
A tag is a piece of code that sends data to a tool, such as a GA4 event or an ad conversion. A trigger listens to your page for events like form submissions, button clicks or page views, and tells the tag to fire when it sees one. Every tag must have at least one trigger in order to fire [2]. Variables hold values that Tag Manager reads, and Google says they simplify and automate your tag setup [1].
You can narrow a trigger with a filter. Google's example is a page-view trigger that only fires when the Page URL contains /products/, which catches every product page [2].
How do I install a Google Tag Manager container on my site?
- Create the account and container Go to tagmanager.google.com, sign in, create an account, then name the container after your top-most site address, for example www.example.com. Pick Web as the type [4].
- Paste the snippet Google's developer page shows the container code, with your own GTM ID in place of GTM-XXXXXX [5].
- Preview before you publish Turn on preview and debug mode to browse your site as if the draft were live, and check in Tag Assistant which tags fired and in what order [3].
<script>
window.dataLayer = window.dataLayer || [];
</script>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXX');</script>
<!-- End Google Tag Manager -->
You do not need a container for each page of your website [4]. One container serves the whole site.
What is the data layer and when do I need it?
The data layer is an object used by Google Tag Manager and gtag.js to pass information to tags. Events or variables can be passed through it, and triggers can be set up on their values [5]. Your developer pushes a message into it when something happens, and a trigger in Tag Manager reacts.
dataLayer.push({ 'event': 'quote_form_sent', 'service': 'aircon-servicing' });
Google's own example ties a button to dataLayer.push({'event': 'login'}) [5]. The event name above is made up for a Singapore aircon firm: your Tag Manager trigger would listen for quote_form_sent and fire a Google Ads or GA4 tag. Google also says each variable in the data layer lasts only while the visitor stays on the current page, so push it again on every page load [5].
Do I need Tag Manager if I already have a Google tag on my site?
Not strictly. Campaign links tagged with UTM parameters work with or without it. For basic GA4 data collection you can paste the Google tag directly after the opening head tag of each page [6]. Tag Manager earns its place once you have several tags, for example Analytics, an ad conversion and the Meta Pixel, and you want to change them without a developer. Google says the best practice is to migrate all your tags at once, but it is not required, because Tag Manager fires migrated tags alongside tags set up outside it [1].
If you run paid search, a broken tag costs money without any warning, so read Google Ads conversion tracking broken and test in preview mode before each publish. See also conversion tracking.
Questions people ask
Is Google Tag Manager the same as Google Analytics?
No. Tag Manager is the delivery tool that holds and fires tags. Google Analytics is one of the tools a tag can send data to. Google says a container can replace tags from Google Ads, Google Analytics, Floodlight and third-party tools [1].
How many Tag Manager accounts do I need?
Google says you can create several accounts from one Google login, but you will typically only need one Tag Manager account per company or organisation. One account can look after one or more websites or apps [1].
Where do I test a change before it goes live?
Use preview and debug mode. It loads your site as if the current draft were published, connected to Tag Assistant, so you can see which tags fired and in what order [3].
Pages that link here
Bounce rate, Conversion rate, Conversion tracking, Cookie consent, Core Web Vitals, GA4, INP, Meta Pixel, Smart Bidding, UTM parameters
See also
- GA4 GA4 is the current version of Google Analytics, which records what visitors do on your website and app as events and shows them in reports.
- Meta Pixel The Meta Pixel, once called the Facebook Pixel, is a snippet of code on your website that reports what visitors do after seeing your Facebook or Instagram ads.
- UTM parameters UTM parameters are short tags added to the end of a link so your analytics tool can see which campaign, email or post sent each visitor.
- Conversion tracking Conversion tracking records when a visitor does something you care about, such as sending a form or tapping WhatsApp, and ties it back to the ad that brought them.
- Cookie consent Cookie consent is a website visitor's choice to allow or refuse cookies that collect their data, usually collected through a banner.
References
- Introduction to Tag Manager, Tag Manager Help. Read 27/11/2026.
Google Tag Manager is a tag management system that allows you to set up and manage tags on your site without changing your website's code.
- About triggers, Tag Manager Help. Read 27/11/2026.
Every tag must have at least one trigger in order to fire.
- Preview and debug containers, Tag Manager Help. Read 27/11/2026.
Your previewed site is connected to Tag Assistant so that you can inspect which tags fired and in which order.
- 1. Create an account and container, Tag Manager Help. Read 27/11/2026.
You don't need a container for each page of your website.
- The data layer, Google for Developers. Read 27/11/2026.
The data layer is an object used by Google Tag Manager and gtag.js to pass information to tags.
- Set up Analytics for a website and/or app, Google Analytics Help. Read 27/11/2026.
Paste your Google tag immediately after the <head> on each page of your website.