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.

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.

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
- Go to https://tagmanager.google.com
- Click Create Account.
- Enter your Account Name (usually your company name).
- Set your Country.
- Under Container Setup, enter your website name (e.g.,
example.com). - Choose Web as the target platform.
- 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.

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.
- Install and activate the plugin.
- Paste your GTM container ID (looks like
GTM-XXXXXXX) in the plugin settings. - 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).
- In your GTM dashboard, click Tags → New.
- Name your tag:
GA4 - Pageview. - Choose Tag Configuration → Google Analytics: GA4 Configuration.
- Enter your Measurement ID (found in your GA4 Admin → Data Streams).
- Set the Trigger to All Pages.
- Click Save, then Submit and Publish your container.
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
- Create a new Tag → Choose Custom HTML.
- Paste your Meta Pixel code.
- Trigger: All Pages or specific conversion pages.
- Publish changes.
LinkedIn Insights Tag
- Create a Tag → Choose LinkedIn Insight.
- Enter your Partner ID.
- Trigger: All Pages.
- Save and publish.
Google Ads Conversion Tracking
- Add a New Tag → Google Ads Conversion Tracking.
- Enter your Conversion ID and Label.
- 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:
- Click Preview in the GTM dashboard.
- Enter your website URL.
- 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.
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:
- Click Submit → Publish in GTM.
- Name your version (e.g., “GA4 + Meta Pixel Setup”).
- 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