Google Tag Manager

Google Tag Manager Setup Guide

By Bappi Hossain3 min read
Google Tag Manager Setup Guide
Table of contents
  1. What Google Tag Manager does
  2. Step 1: Create the account and container
  3. Step 2: Install the snippets
  4. Step 3: Understand tags, triggers and variables
  5. Step 4: Use the dataLayer for important events
  6. Step 5: Test in Preview mode
  7. Step 6: Name things and publish versions
  8. Do not forget consent
  9. FAQ

Quick answer: Create a GTM account and a web container, add the two GTM snippets to every page, then build tracking with three parts: tags (what to send), triggers (when to send it) and variables (the details). Test every change in Preview mode, publish with a clear version name, and keep a simple naming system so the container stays readable.

What Google Tag Manager does

Google Tag Manager is a free tool that holds all your tracking tags in one container. Instead of asking a developer to edit the site every time marketing needs a new pixel, you add and change tags in GTM and publish them in versions you can roll back.

Step 1: Create the account and container

At tagmanager.google.com, create an account for the business and a Web container for the website. One container per website is the usual rule.

Step 2: Install the snippets

GTM gives you two pieces of code. The first goes as high as possible in the <head>, the second right after the opening <body> tag. On WordPress you can use a lightweight plugin or your theme’s header settings. On Shopify, add the head snippet to the theme layout.

Step 3: Understand tags, triggers and variables

  • Tags send data: the Google tag for GA4, Google Ads conversion tags, the Meta Pixel.
  • Triggers decide when a tag fires: all pages, a click on a button, a form submit, or a custom dataLayer event.
  • Variables hold values: a page path, a click URL, an order value pushed to the dataLayer.

Step 4: Use the dataLayer for important events

Clicks and page views can be tracked without code, but purchases and leads are best sent through the dataLayer, for example dataLayer.push({event: 'generate_lead'}). This is more reliable than guessing from page URLs or button text.

Step 5: Test in Preview mode

Click Preview, open your site and use the Tag Assistant panel to see which tags fired on each event and which did not. Fix triggers until every tag fires once, at the right moment.

Step 6: Name things and publish versions

Use a simple pattern such as GA4 - Event - generate_lead or Ads - Conversion - Purchase. When you publish, write what changed in the version name. Six months later you will thank yourself.

If you have visitors from regions with consent laws, set up Consent Mode v2 with a consent banner so Google tags adjust their behaviour to each visitor’s choice.

FAQ

Does GTM slow down my website?

The container itself is light. Speed problems come from loading too many third-party tags, so keep the container clean.

Can I use GTM with Shopify?

Yes for the storefront. Checkout events are best tracked with Shopify’s Customer Events and a custom pixel.

What is the difference between GTM and GA4?

GA4 is the analytics tool that stores and reports data. GTM is the tool that sends data to GA4 and other platforms.

Want a clean container? See my Google Tag Manager service.

Share
Bappi Hossain
Written by

Bappi Hossain

Google Ads and tracking specialist. I help businesses build reliable GTM, GA4, Google Ads, Meta CAPI and server-side tracking so they can see what is actually converting.

Keep reading

Related Articles

All articles

Ecommerce Tracking Guide

Track the full ecommerce funnel in GA4, Google Ads and Meta: the right events, item data, transaction IDs, Shopify and WooCommerce setup,…

Read More

Something Isn't Tracking?
Let's Find Out Why.

Tell me what you're trying to measure and what's currently not working. I'll take a look and suggest the best way forward.

Scroll to Top