Google Tag Manager — Beginner’s Guide

Google Tag Manager — Beginner’s Guide

Every time you want to add a tracking pixel, update your analytics code, or set up a new conversion — do you email your developer and wait three days?

Google Tag Manager (GTM) eliminates that bottleneck. It’s a free tool that lets you manage all tracking codes on your website through a simple interface, without touching the site’s source code.

This guide covers what GTM is, why you need it, how to install it, and the 5 tags every website should have.

What Is Google Tag Manager?

GTM is a tag management system. Think of it as a container that sits on your website and holds all your tracking codes (tags).

Instead of embedding Google Analytics, Google Ads conversion tracking, Meta Pixel, and other scripts directly into your website’s HTML, you install GTM once and manage everything through its web interface.

Why You Need GTM

Without GTM:

TaskProcessTime
Add GA4 trackingAsk developer to edit code1-3 days
Add Google Ads conversionAsk developer to edit code1-3 days
Add Meta PixelAsk developer to edit code1-3 days
Track form submissionsAsk developer to write custom code3-5 days
Fix a tracking bugAsk developer to debug and redeploy1-5 days
Test changesDeploy to production (risky)Varies

Total dependency on developers. Slow. Error-prone. Expensive.

With GTM:

TaskProcessTime
Add GA4 trackingAdd tag in GTM, publish10 minutes
Add Google Ads conversionAdd tag in GTM, publish10 minutes
Add Meta PixelAdd tag in GTM, publish10 minutes
Track form submissionsCreate trigger + tag in GTM30 minutes
Fix a tracking bugEdit tag in GTM, preview, publish15 minutes
Test changesUse Preview mode (safe)5 minutes

Self-service. Fast. Safe. Free.

3 Key Concepts

GTM is built on three building blocks. Understand these and you understand GTM.

1. Tags

What: Pieces of code that do something. Send data to Google Analytics, fire a conversion pixel, load a chat widget.

Examples:

  • GA4 Configuration tag (sends data to Google Analytics)
  • Google Ads Conversion tag (tracks a conversion)
  • Meta Pixel tag (sends data to Facebook)
  • Custom HTML tag (any code snippet)

Analogy: Tags are the workers. They do the actual job.

2. Triggers

What: Rules that tell a tag WHEN to fire.

Examples:

  • Page View (fires on every page load)
  • Click — specific element (fires when someone clicks a button)
  • Form Submission (fires when a form is submitted)
  • Scroll Depth (fires when user scrolls to 25%, 50%, 75%, 90%)
  • Timer (fires after X seconds on page)
  • Custom Event (fires when your code sends a specific event)

Analogy: Triggers are the managers. They tell workers when to start.

3. Variables

What: Dynamic values that tags and triggers use.

Examples:

  • {{Page URL}} — the current page URL
  • {{Click Text}} — the text of the element that was clicked
  • {{Click URL}} — the URL of the link that was clicked
  • {{Form ID}} — the ID of the submitted form
  • Custom JavaScript variables — any value you can compute

Analogy: Variables are the data. Workers and managers use them to make decisions.

How they work together:

User clicks "Add to Cart" button
    → Trigger: Click trigger (Click Text = "Add to Cart")
        → Fires Tag: GA4 Event tag (event_name = "add_to_cart")
            → Uses Variable: {{Product Name}} from data layer

Installing GTM: Step by Step

Step 1: Create a GTM account

  1. Go to tagmanager.google.com
  2. Click „Create Account“
  3. Enter account name (your company name)
  4. Enter container name (your website URL)
  5. Select „Web“ as target platform
  6. Accept terms of service

Step 2: Get the installation code

GTM gives you two code snippets:

Snippet 1: Goes in the of every page (as high as possible)

<!-- 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-XXXXXXX');</script>
<!-- End Google Tag Manager -->

Snippet 2: Goes immediately after the opening tag

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

Step 3: Add to your website

WordPress: Use a plugin like „GTM4WP“ or „Insert Headers and Footers.“ Paste Snippet 1 into the header and Snippet 2 into the body.

Shopify: Go to Online Store → Themes → Edit code → theme.liquid. Add the snippets in the correct locations.

Custom website: Have your developer add the snippets once. After that, you won’t need them again.

Most CMS platforms (Wix, Squarespace, Webflow, etc.) have dedicated GTM integration options in their settings.

Step 4: Verify installation

  1. Go to your website
  2. Right-click → View Page Source
  3. Search for „GTM-“ — you should find your container ID
  4. Alternatively, use the Google Tag Assistant to verify

Your First Tag: GA4

Let’s set up Google Analytics 4 tracking — the most important tag for any website.

Step 1: Create the GA4 tag

  1. In GTM, click „Tags“ → „New“
  2. Tag name: GA4 Configuration
  3. Tag type: Google Analytics: GA4 Configuration (or Google tag)
  4. Measurement ID: Enter your GA4 ID (starts with G-, found in GA4 → Admin → Data Streams)

Step 2: Set the trigger

  1. Click „Triggering“
  2. Select „All Pages“ (built-in trigger)
  3. This means GA4 will track every page load

Step 3: Preview and test

  1. Click „Preview“ in the top right of GTM
  2. Enter your website URL
  3. Your site opens with a debug panel at the bottom
  4. Verify: The GA4 Configuration tag should show as „Fired“
  5. Go to GA4 → Reports → Realtime to confirm data is flowing

Step 4: Publish

  1. Click „Submit“ in the top right
  2. Add a version name (e.g., „Added GA4 tracking“)
  3. Click „Publish“

Done. GA4 is now tracking your website through GTM.

5 Must-Have Tags for Every Website

1. GA4 Configuration

What: Base Google Analytics tracking Trigger: All Pages Why: Foundation for all analytics. Without this, nothing else matters.

2. GA4 Conversion Events

What: Track key conversions (purchases, form submissions, signups) Trigger: Specific actions (form submit, thank-you page view, purchase event) Why: Know what’s working. See our GA4 conversion tracking guide.

3. Google Ads Conversion Tracking

What: Send conversion data back to Google Ads Trigger: Same as GA4 conversion events Why: Enables Smart Bidding, accurate ROAS reporting, and campaign optimization.

Setup:

  1. In Google Ads, go to Tools → Conversions → New conversion action
  2. Choose „Website“
  3. Select „Use Google Tag Manager“
  4. Copy the Conversion ID and Conversion Label
  5. In GTM, create a new Google Ads Conversion Tracking tag
  6. Enter the ID and Label
  7. Set the trigger to your conversion event

4. Google Ads Remarketing Tag

What: Builds audience lists for remarketing campaigns Trigger: All Pages Why: Enables you to show ads to people who’ve already visited your site.

Setup:

  1. In GTM, create a Google Ads Remarketing tag
  2. Enter your Google Ads Conversion ID
  3. Trigger: All Pages
  4. Publish

5. Meta (Facebook) Pixel

What: Tracks visitors for Meta advertising (Facebook, Instagram) Trigger: All Pages (base pixel) + specific events Why: Required for Meta Ads optimization, remarketing, and conversion tracking.

Setup:

  1. In Meta Events Manager, get your Pixel ID
  2. In GTM, create a Custom HTML tag
  3. Paste the Meta Pixel base code
  4. Trigger: All Pages
  5. For specific events (Purchase, Lead), create additional Custom HTML tags with the appropriate Meta event code

Advanced Tips

Use the Data Layer

The Data Layer is a JavaScript object that passes information from your website to GTM. It’s the bridge between your site and your tags.

Example: When a purchase happens, your website pushes data to the Data Layer:

dataLayer.push({
  event: 'purchase',
  ecommerce: {
    transaction_id: 'T12345',
    value: 149.99,
    currency: 'EUR',
    items: [{
      item_id: 'SKU001',
      item_name: 'Running Shoes',
      price: 149.99,
      quantity: 1
    }]
  }
});

GTM reads this data and sends it to GA4, Google Ads, Meta — wherever you need it. One data source, multiple destinations.

Use folders for organization

As your GTM container grows, organize tags, triggers, and variables into folders:

  • Analytics (GA4)
  • Advertising (Google Ads, Meta)
  • Utilities (Consent mode, custom scripts)

Always preview before publishing

The Preview mode exists for a reason. Every change should be tested before going live. One misconfigured tag can break your entire tracking setup.

Set up a version naming convention

When you publish, always add a descriptive version name:

  • „v1.0 — Initial GA4 + Google Ads setup“
  • „v1.1 — Added form submission tracking“
  • „v1.2 — Fixed purchase event parameters“

This lets you roll back to a specific version if something breaks.

Summary

ConceptWhat It DoesExample
TagSends data somewhereGA4 tracking, Ads conversion pixel
TriggerTells a tag when to firePage view, form submit, button click
VariableProvides dynamic dataPage URL, click text, product price
Data LayerBridge between website and GTMPurchase data, user data
Preview ModeSafe testing environmentTest before going live

What’s Next?

  1. GA4 Conversion Tracking Setup — Use GTM to track what matters
  2. Connect GA4 to Google Ads — Complete the tracking loop
  3. Google Ads for Beginners — Now that tracking is set up, start advertising

If you need help installing GTM or setting up your tracking stack, book a free 30-minute consultation. We’ll review your current setup and identify what’s missing.

About the author: Martin Bradac — PPC & SEO specialist with 9+ years of experience managing €80K+/month in ad spend.

Enjoyed this article? Read next:

Need help with this?

Book a free 30-minute consultation and let’s discuss your project.

Free Consultation
Martin Bradac

Martin Bradac

PPC & SEO Specialist

9+ years of experience with Google Ads, Meta Ads and SEO. Managing €80K+/month in ad accounts.