What this guide covers
Simple, practical steps to set up Google Tag Manager (GTM) for your website. You’ll learn how to create an account and container, install GTM on your site, add common tags (GA4 and a conversion), test them, and publish. No technical degree needed.
Quick decision rules
- If you only need basic analytics and you're using Google Analytics, use GTM + GA4 tag.
- If you need to track button clicks or form submissions, use GTM triggers (no code change usually needed).
- If your developer can push events from the server or complex pages, use dataLayer for reliable tracking.
Before you start — checklist
- Create or use a Google account (Gmail) you control.
- Know your website platform (WordPress, Shopify, custom HTML).
- Have access to edit website header/footer or to your platform's script settings.
- Find your Google Analytics Measurement ID (if you already have GA4).
Step 1 — Create a GTM account and container
- Go to tagmanager.google.com and sign in with your Google account.
- Click "Create Account": name it your business name.
- Set country and container name (use your domain: example.com). Choose "Web" as the target.
- Click "Create" and accept terms.
Step 2 — Install the GTM container on your site
GTM gives two code snippets. One goes in the <head> and one immediately after the opening <body> tag.
- Copy the head snippet and paste it into your site’s header file or theme setting that accepts header scripts.
- Copy the body snippet and paste it right after <body> opening tag or into the platform's body script area.
- If you use WordPress, use a header/footer plugin or theme's custom scripts area. If Shopify, paste into theme.liquid before </head> and after <body>.
Step 3 — Use Preview (Tag Assistant) to confirm GTM is active
- In GTM, click "Preview". Enter your site URL and click "Connect."
- Your site will open with a debug pane showing GTM events. If you see events like "Page View," GTM is installed correctly.
Step 4 — Add Google Analytics 4 (GA4) via GTM
Example: GA4 Measurement ID looks like G-XXXXXXXXXX.
- In GTM, go to Tags → New → Tag Configuration → GA4 Configuration.
- Enter your Measurement ID (from Google Analytics → Admin → Data Streams).
- Set Triggering to "All Pages" so it fires on every page.
- Save tag. Use Preview to confirm the GA4 Configuration tag fires on page load.
Step 5 — Add a simple conversion tag (example: contact form submission)
Two common ways: 1) form confirmation page URL, 2) form submission trigger inside GTM.
- If your form redirects to /thank-you, create a trigger: Trigger Type = Page View → Page Path contains "/thank-you".
- Create a Tag: Google Analytics: GA4 Event. Event name = "contact_form". Set Parameter "value" if needed.
- Attach the thank-you trigger and save. Preview to confirm it fires only on the thank-you page.
Step 6 — Track button clicks (no code change)
- Enable built‑in variables: Go to Variables → Configure and check Click ID, Click Classes, Click Text.
- Create a trigger: Trigger Type = Click → All Elements. Set to fire on Some Clicks where Click Text contains "Buy" (or another button text).
- Create a GA4 Event tag named "button_click" and attach the click trigger. Include Click Text as a parameter for reporting.
- Preview and click the real button to see the event in the debug pane.
Step 7 — Use dataLayer for reliable custom events (when to choose this)
Choose dataLayer when: your page loads dynamic content, forms don’t redirect, or you want exact event data (order totals, product IDs).
- Ask your developer to push an event: dataLayer.push({"event":"purchase","value":99.95,"order_id":"1234"});
- In GTM create a Custom Event trigger named "purchase" (Event name = purchase).
- Create a GA4 Event tag mapping order value → event parameter "value". Attach the custom event trigger.
Step 8 — Test thoroughly and check Google Analytics
- Use GTM Preview to verify tags fire as expected on test pages.
- Open GA4 → Reports → Real-time to see events arriving when you trigger them.
- Test across devices and pages where tracking matters (mobile, checkout, forms).
Step 9 — Publish your container
- When tests pass, click "Submit" in GTM, add a brief version name (e.g., "GA4 + click tracking"), and publish.
- Record the change in your operations notes: who published and why.
Quick troubleshooting checklist
- No events in preview: confirm GTM snippets are on page and not blocked by extensions.
- GA4 tag not sending data: verify Measurement ID and that the GA4 tag fired in preview.
- Click trigger not firing: check Click Text/ID matches exactly or use a broader match like contains.
Simple maintenance rules
- Monthly: open GTM Preview and spot-check key events (checkout, contact form, lead ads).
- When you change the site (new theme, major form change), retest tracking immediately.
- Keep a short changelog: date, what changed, who approved.
Minimal testing plan (5–10 minutes)
- Load 3 key pages: home, product/service, thank-you. Use Preview to ensure GA4 Configuration fires.
- Submit test form and verify contact_form event in GA4 real-time.
- Click primary CTA (buy/contact) and verify button_click event arrives.
Resources and terms cheat sheet
- GTM Container: the set of tags, triggers, variables for a site.
- Tag: code that sends data (e.g., GA4 config or event).
- Trigger: rule that tells a tag when to fire (page load, click, custom event).
- Variable: a value GTM can use (Click Text, Page URL, dataLayer values).
Final quick checklist before you finish
- GTM snippets placed in head and body.
- GA4 Configuration tag added and firing on all pages.
- At least one conversion (thank-you or form) tracked.
- Preview-tested and validated in GA4 real-time.
- Published container and a short changelog entry saved.
You’re set. Start simple (GA4 + 1 conversion) and add more tags when you need them.