Free SEO audit for new clients — claim yours
Home/Blog/Analytics/Google Tag Manager for Beginners
Analytics

Google Tag Manager for Beginners

Google Tag Manager for Beginners
Table of contents
  1. Key Takeaways
  2. What is Google Tag Manager?
    1. GTM vs Google Analytics vs the Google tag
  3. Core concepts: account, container, tags, triggers, variables
    1. Common trigger types
  4. How to install Google Tag Manager: step by step
  5. Set up GA4 through Tag Manager
  6. Track clicks and form submissions
    1. The data layer in 60 seconds
  7. Consent mode basics
  8. Testing and publishing with confidence
  9. Common mistakes
  10. Where to go next
  11. Related Guides
  12. Frequently Asked Questions
    1. Is Google Tag Manager free?
    2. Do I still need Google Analytics if I use Tag Manager?
    3. Will Google Tag Manager slow down my website?
    4. Can I use Tag Manager and hard-coded tags together?
    5. What is the difference between a tag, a trigger and a variable?
    6. Do I need a developer to use Google Tag Manager?
  13. Conclusion
  14. References

Every marketing tool wants a snippet of code on your website: Google Analytics, Google Ads conversion tracking, the Meta Pixel, LinkedIn Insight, heatmaps, chat widgets. Add them one by one to your theme files and you soon have a fragile mess that only a developer dares touch, and nobody remembers which tag does what.

Google Tag Manager (GTM) solves that. You install one container on your site, then add, edit, test and remove tags from a web interface, with version history and a preview mode so you can check everything before it goes live.

This beginner's guide explains the core concepts, walks you through installation and your first GA4 setup, shows how to track clicks and form submissions, introduces the data layer and consent mode, and lists the mistakes that most often break tracking.

Key Takeaways

  • Google Tag Manager is a free tag management system for deploying tracking code without editing your site's code each time.
  • Everything in GTM is built from three parts: tags (what to send), triggers (when to send it) and variables (the values used).
  • Installation means adding two snippets: one high in the <head> and one immediately after the opening <body> tag.
  • Always test in Preview mode with Tag Assistant before publishing, and name every tag, trigger and variable clearly.
  • If you have visitors in regions that require consent, set up consent mode so tags respect users' choices.

What is Google Tag Manager?

Google describes Tag Manager as:

“a tag management system that allows you to set up and manage tags on your site without changing your website's code.”

— Google, Introduction to Tag Manager

A “tag” is a snippet of code that sends information to a third party, such as a page view to Google Analytics or a purchase to Google Ads. Tag Manager does not report on anything itself. It is the delivery system. The data is stored and analysed in the tools the tags send to, most often Google Analytics 4.

GTM vs Google Analytics vs the Google tag

ToolWhat it doesDo you need it?
Google Tag ManagerDeploys and manages tags and their firing rulesRecommended when you use more than one or two marketing tags
Google tag (gtag.js)Google's tag for sending data to GA4 and Google Ads; can be installed directly or through GTMYes, if you use GA4 or Google Ads
Google Analytics 4Collects, processes and reports dataYes, for website analytics

Core concepts: account, container, tags, triggers, variables

  • Account: the top level, usually one per company.
  • Container: one per website or app. It holds all the tags, triggers and variables for that site. Its ID looks like GTM-XXXXXXX.
  • Tag: the code that sends data, for example a Google tag for GA4, a GA4 event tag or a Meta Pixel template.
  • Trigger: the condition that fires a tag, such as “all page views”, “clicks on links containing /contact” or “form submission”.
  • Variable: a value GTM can read and use, such as Page URL, Click Text or a value from the data layer.
  • Workspace and versions: changes are made in a workspace and published as a numbered version you can roll back to.

Common trigger types

Trigger typeFires whenTypical use
Page View / InitializationA page starts loading (or GTM initialises)Google tag, consent setup, analytics base tags
Click – Just LinksA link is clickedOutbound links, phone (tel:) and email (mailto:) links, file downloads
Click – All ElementsAny element is clickedButtons that aren't links
Form SubmissionA form's submit event is detectedLead forms (test carefully; many forms need a data layer event instead)
Scroll DepthThe user scrolls past set percentagesContent engagement
Element VisibilityAn element appears on screen“Thank you” messages, key sections viewed
Custom EventA dataLayer.push event is receivedReliable tracking for purchases, sign-ups and app-like sites

How to install Google Tag Manager: step by step

  1. Create an account and container. Go to tagmanager.google.com, create an account for your company and a Web container named after your site's domain.
  2. Copy the two snippets. GTM shows two blocks of code. Google's instructions: paste the first “as high in the <head> tag as possible” and the second “immediately after the opening <body> tag.” Add them to every page, usually via your theme's header template.
  3. Or use your CMS. Many platforms and plugins let you paste only the container ID. In WordPress, a reputable plugin or Google's Site Kit can add the container for you.
  4. Check for duplicates. If GA4 or Google Ads tags are already hard-coded, plan to remove them once the GTM versions are live.
  5. Preview. Click Preview, enter your URL and confirm Tag Assistant connects. You should see the container load.
  6. Publish. Click Submit, give the version a descriptive name (e.g. “Install container + GA4 base”), and publish.

Set up GA4 through Tag Manager

  1. In GA4, go to Admin > Data streams, open your web stream and copy the measurement ID (it starts with G-).
  2. In GTM, create a new tag of type Google tag and paste the ID.
  3. Set the trigger to Initialization – All Pages (or All Pages).
  4. Name it clearly, e.g. “GA4 – Google tag – All pages”.
  5. Preview, browse a few pages, and check that GA4's Realtime or DebugView report shows your visit.
  6. Submit and publish.

GA4's enhanced measurement already tracks scrolls, outbound clicks, site search, video engagement and file downloads automatically, so check what it covers before building duplicate tags.

Track clicks and form submissions

A common first project is tracking calls and leads. For phone links:

  1. In Variables, enable the built-in click variables (Click URL, Click Text).
  2. Create a trigger: Click – Just Links, firing on “Some link clicks” where Click URL starts with tel:.
  3. Create a tag: Google Analytics: GA4 Event, event name phone_click, using your measurement ID, with that trigger.
  4. Preview, click a phone link, and confirm the tag fired.
  5. Publish, then mark the event as a key event in GA4 if it represents a lead.

Forms are trickier. Many modern forms submit with JavaScript, so GTM's Form Submission trigger may not fire. The most reliable method is to ask your developer, or your form plugin, to push an event to the data layer when a form is successfully submitted.

The data layer in 60 seconds

Google defines the data layer as “an object used by Google Tag Manager and gtag.js to pass information to tags.” Your site pushes events and values into it; GTM listens and fires tags. A minimal example:

<script>
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({
    'event': 'generate_lead',
    'form_name': 'contact'
  });
</script>

In GTM, create a Custom Event trigger for generate_lead, a Data Layer Variable for form_name, and a GA4 event tag that sends both. If you set page-level data layer values, Google recommends pushing them above the container snippet so they're available when it loads.

If you have visitors in the EEA, the UK or other regions with consent requirements, your tags need to respect cookie choices. Google's consent mode “allows web and app developers to adjust tag and app SDK behavior based on user consent choices.” It uses four main consent types: ad_storage, analytics_storage, ad_user_data and ad_personalization.

  • Basic consent mode: Google tags don't load until the user interacts with the consent banner.
  • Advanced consent mode: Google tags load immediately with default consent states and adjust their behaviour based on the user's choice.

Most consent management platforms offer a GTM template that sets defaults and updates consent automatically. This is a legal as well as technical decision, so involve whoever owns privacy compliance.

Testing and publishing with confidence

Preview mode connects your site to Tag Assistant so you can see which tags fired, in what order, and which variables had which values. Google notes the debug view only appears in the browser that enabled preview (or for users you share the preview link with), so your visitors never see it. Before every publish:

  • Test the exact action (click, form, purchase) in preview.
  • Check the receiving tool (GA4 DebugView, Google Ads tag diagnostics) shows the data.
  • Name the version and describe what changed.
  • If something breaks, use Versions to restore the last working version.

Common mistakes

  • Double-tagging. GA4 installed in the theme and in GTM doubles page views and inflates sessions.
  • Vague names. “Tag 7” and “Click trigger copy” become unmanageable. Use a convention: Tool – Type – Detail.
  • Tracking clicks instead of successes. Counting “submit button clicks” records failed submissions too. Track the confirmation.
  • Publishing without previewing. A broken trigger can silently stop all conversion tracking.
  • Too many third-party tags. Every script costs performance. Audit the container quarterly; our guide to improving page speed explains how to measure the impact.
  • UTM tags on internal links. Campaign parameters belong on links from other sites and emails, not between your own pages. See our UTM parameters guide.
  • Too many admins. Give publish rights only to people who understand the impact.

Where to go next

Once tags are firing reliably, the value comes from using the data. Learn how to read engagement in GA4 with our guide to engagement rate vs bounce rate, decide how to credit channels with marketing attribution models, and bring everything together in an SEO dashboard. If you also want to measure visits from AI assistants, see how to track AI traffic in GA4.

Frequently Asked Questions

Is Google Tag Manager free?

Yes. The standard version of Google Tag Manager is free. A paid enterprise version, Tag Manager 360, is available as part of Google Marketing Platform for large organisations.

Do I still need Google Analytics if I use Tag Manager?

Yes. Tag Manager only deploys tags; it does not store or report data. Google Analytics 4 collects and reports the data that your GA4 tags in Tag Manager send to it.

Will Google Tag Manager slow down my website?

The container itself is loaded asynchronously, but every tag you add can affect performance. Keep the container lean, remove unused tags, and test page speed after adding new third-party scripts.

Can I use Tag Manager and hard-coded tags together?

Yes, but avoid installing the same tag twice, for example a GA4 Google tag hard-coded in the theme and again in Tag Manager, as that can double-count page views and events.

What is the difference between a tag, a trigger and a variable?

A tag is the code that sends data somewhere, a trigger is the rule for when the tag fires, and a variable is a value, such as a page URL or click text, that tags and triggers can use.

Do I need a developer to use Google Tag Manager?

Not for most tasks. Installing the container may need help from your developer or CMS plugin, and complex data layer setups for ecommerce usually need a developer, but page views, clicks, form submissions and many marketing pixels can be configured in the interface.

Conclusion

Google Tag Manager gives you control over your tracking without waiting on code releases for every change. Install the container carefully, start with GA4 and one or two key events, test everything in preview, and grow from there. Accurate tracking is the foundation of better campaigns and better websites. If you'd like help setting up conversion tracking that you can trust, our PPC management and conversion optimisation teams can help, or get a free quote.

References

  1. Introduction to Tag Manager – Tag Manager Help
  2. Install a web container – Tag Manager Help
  3. Preview and debug containers – Tag Manager Help
  4. The data layer – Google Tag Platform
  5. Consent mode overview – Google Tag Platform
  6. What Is Google Tag Manager & How Does It Work? – Semrush Blog
My SEO Experts Team

Our team of SEO and digital marketing specialists has been helping businesses grow organically since 2018. More about us.

Keep reading

Related articles

How to Measure and Improve SEO ROI
Analytics

How to Measure and Improve SEO ROI

SEO ROI shows whether organic search is paying off. Learn how to calculate it, track the right data in GA4 and Search Console, and improve your return.

SEO KPIs: 15 Metrics to Track and Report
Analytics

SEO KPIs: 15 Metrics to Track and Report

Not every SEO number deserves a place in your report. These 15 SEO KPIs cover visibility, traffic, engagement, technical health, authority and revenue, with sources and targets for each.

Ready to grow your business online?

Get a free, no-obligation proposal tailored to your goals and budget.

CallFree Quote