website

How to Set Up Google Tag Manager: A Complete Step-by-Step Guide

Learn how to set up Google Tag Manager from scratch, including container creation, tag installation, and configuration for Google Analytics and other tracking tools.

By Growth Reactor TeamNovember 2, 2025
How to Set Up Google Tag Manager: A Complete Step-by-Step Guide

How to Set Up Google Tag Manager: A Complete Step-by-Step Guide

Google Tag Manager (GTM) is one of the most powerful tools for marketers and website owners. It allows you to manage tracking codes, conversion pixels, and scripts — all without constantly editing your website’s code. This guide will walk you through setting up Google Tag Manager from scratch, installing it on your website, and configuring essential tags such as Google Analytics 4 (GA4), Meta Pixel, and LinkedIn Insights Tag.

Google Tag Manager dashboard


What Is Google Tag Manager?

Google Tag Manager is a free tool by Google that allows you to easily manage and deploy marketing tags (snippets of code or tracking pixels) on your website or app — without requiring direct developer support after the initial setup.

Instead of manually placing scripts for tools like Google Analytics, Google Ads, or Meta Pixel, you install one GTM container code on your site, and then manage everything else from the GTM dashboard.

Benefits of Using GTM

  • Centralized management of all your tags and scripts
  • No need for developer intervention after initial setup
  • Built-in debugging and preview features
  • Easy version control and rollback options

Step 1: Create a Google Tag Manager Account

  1. Go to https://tagmanager.google.com
  2. Click Create Account.
  3. Enter your Account Name (usually your company name).
  4. Set your Country.
  5. Under Container Setup, enter your website name (e.g., example.com).
  6. Choose Web as the target platform.
  7. Click Create, then accept the GTM Terms of Service.

Once created, you’ll receive your Container Snippet — a short JavaScript code that needs to be added to your site.

GTM container snippet example


Step 2: Install the GTM Container on Your Website

For Standard HTML Websites

Paste the GTM snippets in two places:

  • The first code snippet immediately after the opening <head> tag
  • The second snippet immediately after the opening <body> tag

Your website should now be connected to your GTM container.

For WordPress Websites

You can install GTM easily using a plugin such as Insert Headers and Footers, or Google Tag Manager for WordPress by Thomas Geiger.

  1. Install and activate the plugin.
  2. Paste your GTM container ID (looks like GTM-XXXXXXX) in the plugin settings.
  3. Save changes and verify installation using Tag Assistant.

Step 3: Add Google Analytics 4 via GTM

Now that GTM is installed, let’s connect Google Analytics 4 (GA4).

  1. In your GTM dashboard, click Tags → New.
  2. Name your tag: GA4 - Pageview.
  3. Choose Tag Configuration → Google Analytics: GA4 Configuration.
  4. Enter your Measurement ID (found in your GA4 Admin → Data Streams).
  5. Set the Trigger to All Pages.
  6. Click Save, then Submit and Publish your container.

GA4 setup in GTM

Now, your website automatically sends pageview data to Google Analytics 4 via GTM.


Step 4: Add Additional Marketing Tags

GTM makes it simple to manage all your marketing pixels in one place. Here are some common setups:

Meta (Facebook) Pixel

  1. Create a new Tag → Choose Custom HTML.
  2. Paste your Meta Pixel code.
  3. Trigger: All Pages or specific conversion pages.
  4. Publish changes.

LinkedIn Insights Tag

  1. Create a Tag → Choose LinkedIn Insight.
  2. Enter your Partner ID.
  3. Trigger: All Pages.
  4. Save and publish.

Google Ads Conversion Tracking

  1. Add a New TagGoogle Ads Conversion Tracking.
  2. Enter your Conversion ID and Label.
  3. Choose the appropriate trigger (e.g., thank-you page or form submission event).

Step 5: Use GTM’s Preview and Debug Mode

Before publishing new tags, always test them using GTM’s Preview Mode:

  1. Click Preview in the GTM dashboard.
  2. Enter your website URL.
  3. GTM will open your site in debug mode, showing which tags fire on which pages.

You can also use Tag Assistant (by Google) to confirm that tags are installed and firing correctly.

Tag Assistant preview


Step 6: Set Up Triggers and Variables

Triggers determine when a tag fires, and variables provide dynamic values (like click text or page URL).

Common trigger examples:

  • All Pages – fires on every page
  • Click – All Elements – tracks button clicks
  • Form Submission – tracks form completions

You can also enable Built-in Variables (like Click Text or Page Path) under Variables → Configure.


Step 7: Publish and Maintain Your Container

Once everything works as expected:

  1. Click Submit → Publish in GTM.
  2. Name your version (e.g., “GA4 + Meta Pixel Setup”).
  3. Keep track of versions — you can roll back anytime.

Regularly review your tags to ensure everything stays updated and efficient.


Bonus: Best Practices for GTM

  • Use clear naming conventions for tags, triggers, and variables
  • Document each tag’s purpose within GTM’s notes
  • Use folders to group related tags (e.g., Analytics, Ads, Social)
  • Regularly test and clean up unused tags

Conclusion

Google Tag Manager simplifies how marketers track and measure website interactions. By following this step-by-step guide, you now have GTM installed, connected to Google Analytics 4, and set up to manage all your marketing pixels in one centralized place.

With proper organization and version control, GTM can save hours of development time — and help you make smarter, data-driven marketing decisions.


Written by the Growth Reactor Team