Call

How to Set Up Google Tag Manager (Without Breaking Your Tracking)

A plain-English guide to set up Google Tag Manager on WordPress or Shopify, with GA4, Google Ads tags, testing and consent done right.

ShareLinkedInXWhatsApp

The short answer: To set up Google Tag Manager, create an account and a web container at tagmanager.google.com, install the two code snippets on every page of your site, then add your tags inside GTM instead of pasting code into your site. Start with the Google tag for GA4, the Conversion Linker, and your Google Ads conversion tags, each with a clear trigger. Test everything in Preview mode before you publish, name things properly, and write a note on every version. On Shopify, use the Google & YouTube app for Google tracking rather than forcing GTM into checkout.

Google Tag Manager (GTM) is a free tool that holds all your tracking code in one place. Instead of asking a developer to paste a new script every time you run a campaign, you add it in GTM, test it, and publish. Done well, it makes tracking faster and safer. Done badly, it quietly double counts your leads for a year and Google Ads bids on rubbish data.

This guide walks through a clean setup from scratch: the container, installing it on WordPress and Shopify, the core Google tags, triggers and variables, testing, consent and housekeeping. It is written for business owners and marketing managers who want to understand what good looks like, even if someone else does the clicking.

Step 1: Understand how GTM works before you touch it

GTM has three building blocks. Get these straight and the rest is easy.

  • Tags: the code that sends data somewhere. For example, the GA4 tag sends page views to Google Analytics, and a Google Ads conversion tag tells Google Ads a lead happened.
  • Triggers: the rules for when a tag fires. “On every page”, “when the thank-you page loads”, “when someone clicks a phone number”.
  • Variables: bits of information GTM can read and pass along, like the page URL, the text of a clicked button, or the order value.

Nothing you build in GTM goes live until you hit Publish. Every publish creates a new version, so you can roll back if something breaks. That safety net is the main reason I push clients to use it.

Here is the honest bit. GTM does not fix bad tracking on its own. It just makes it easier to manage. If you do not know what you want to measure, you will end up with a tidy container full of tags that measure the wrong things. Write a short tracking plan first: what counts as a lead or sale, which pages or clicks prove it happened, and where each one needs to be reported.

Step 2: Create your account and container

  1. Go to tagmanager.google.com and sign in with a Google account the business owns. Not a staff member’s personal Gmail, and not your agency’s account.
  2. Create an account. Use your business name.
  3. Create a container. Name it after your website domain and choose Web as the platform.
  4. Accept the terms. GTM then shows you two snippets of code.

Google’s own Tag Manager setup instructions cover the same steps if you want to follow along with screenshots.

One container per website

One container covers every page on one website. If you run two sites, create two containers under the same account. Do not share one container across unrelated sites. It makes triggers messy and mistakes spread.

Sort out access early

Add at least two people with Admin access at the account level: the owner and one trusted person. Give agencies and freelancers Publish access at the container level, not account ownership. In my experience, “we can’t get into our own GTM” is one of the most common and most avoidable problems I see when a new client comes on board.

Step 3: Install GTM on your website

The first snippet goes as high as possible in the <head> of every page. The second goes straight after the opening <body> tag. It must be on every page, including thank-you and booking confirmation pages.

Installing on WordPress

You have three sensible options:

  • A header and footer plugin: paste the head snippet into the header box and the body snippet into the “after body open” box. Simple and fine for most small sites.
  • Your theme’s built-in setting: many modern themes have a field for GTM or custom head code. Check it survives theme updates.
  • A developer adds it to the child theme: the cleanest option if you already have a developer looking after the site through something like our web design service.

Whichever you pick, install GTM once. A very common fault is GTM installed by a plugin and again in the theme, which fires every tag twice.

Installing on Shopify

Shopify is different, and this is where a lot of old advice is now wrong. Shopify’s checkout runs in a locked-down environment, and you cannot paste scripts into it the way you used to. People got around this by running GTM inside a Shopify “custom pixel”. Google now says plainly that running Google tags inside a Shopify custom pixel is not a supported setup, and lists problems like broken Preview mode and missing enhanced conversions.

My approach for most Shopify stores:

  • Use the Google & YouTube app to connect GA4, Google Ads and Merchant Center. It handles purchase tracking through checkout.
  • If you still need GTM for other tools on the storefront, add it to the theme for non-checkout pages only, and make sure it does not duplicate what the app already sends.
  • Check for old tracking code left in the theme or in “additional scripts” from years ago.

If your store tracking is a tangle of apps and old code, our Shopify development team can clean it up.

Check it is installed properly

Once the snippets are in, run your site through our free tracking checker. It shows whether GTM, GA4 and your ad tags are loading, and flags duplicate installs. You can also open Preview mode in GTM (covered in Step 7) and confirm it connects.

Person working on a laptop with website code on the screen
Install GTM once, on every page, then do all your tag work inside it.

Step 4: Add the Google tag for GA4

The Google tag is the base tag for GA4. It loads Google’s measurement code on every page and sends page views.

  1. In GTM, go to Tags, then New.
  2. Choose Google Tag as the tag type.
  3. Enter your GA4 measurement ID (it starts with G-).
  4. Set the trigger to Initialization: All Pages so it loads early.
  5. Name it clearly (more on naming in Step 9) and save.

Then add GA4 event tags for the things that matter: form submissions, phone clicks, bookings, purchases. Each GA4 event tag needs an event name (like generate_lead) and a trigger. If GA4 itself is not set up properly yet, start with our guide on how to set up Google Analytics 4.

Watch for doubles. If your website builder or a plugin already adds GA4, and you add it again in GTM, you will see inflated page views and events. Remove one. My preference is GTM for everything, so there is one source of truth.

Step 5: Add the Conversion Linker and Google Ads tags

Conversion Linker

The Conversion Linker tag stores information from ad clicks (like the GCLID, the Google Click ID added to your URL when someone clicks your ad) so conversions can be matched back to the right click. Without it, you lose conversions that happen after the first page view.

  • Tag type: Conversion Linker.
  • Trigger: All Pages.
  • Only one is needed per container.

Google Ads conversion tags

For each conversion you want Google Ads to count, create a conversion action in Google Ads first. Google Ads gives you a Conversion ID and a Conversion Label. Then in GTM:

  1. New tag, type Google Ads Conversion Tracking.
  2. Paste the Conversion ID and Conversion Label.
  3. Add a conversion value and currency if you have one (AUD for most readers).
  4. Attach the trigger for that action, such as the thank-you page view or a form success event.

Deciding which actions should count, what values to use, and how to count them is a topic on its own. I cover it in our guide on how to set up Google Ads conversion tracking.

Enhanced conversions

Enhanced conversions send a hashed (scrambled one way, so it cannot be read) copy of the email or phone number a customer typed in, which helps Google match more conversions to ad clicks. You can set this up in the Google Ads conversion tag using a “user-provided data” variable. It is worth doing, but get the basics firing correctly first. We set this up regularly through our enhanced conversions service.

Other platforms

The same container can hold Meta, LinkedIn, TikTok and Microsoft Ads tags. The principles are the same: one base tag on all pages, event tags on clear triggers. Our guide on how to set up Meta Pixel covers the Meta side.

Step 6: Build triggers and variables that do not lie

Triggers are where most tracking goes wrong. A tag is only as good as the rule that fires it.

Turn on built-in variables

Go to Variables, then Configure, and switch on the click and form variables (Click URL, Click Text, Click Classes, Form ID, Form Classes). They are off by default, and many triggers need them.

Common triggers and how to make them reliable

What you want to track Best trigger Watch out for
Form submission (lead) Thank-you page view, or a form plugin success event pushed to the data layer The generic “Form Submission” trigger fires even when validation fails
Phone number clicks Click trigger where Click URL starts with tel: A click is not a call. Treat it as a signal, not a confirmed lead
Email clicks Click trigger where Click URL starts with mailto: Low intent on its own. Keep it secondary
Booking confirmed Confirmation page view or booking tool event Booking tools in iframes may need their own tracking
Purchase Purchase event from your platform or the Google & YouTube app on Shopify Order page refreshes counting twice
Thank-you page Page view where Page Path equals your exact thank-you URL “Contains” matches more pages than you think

Use the data layer where you can

The data layer is a small bit of code on your site that passes information to GTM, like “form submitted” or “order value 189.00”. It is far more reliable than guessing from clicks. Most good form plugins and eCommerce platforms can push events to it. If yours cannot, a developer can add a line or two.

A quick example. A Rockingham physio clinic I looked at was counting “lead” every time someone clicked the Book Now button. Most of those people opened the booking page and left. Switching the trigger to the booking confirmation event cut their reported conversions sharply, and the numbers finally matched the appointment book.

Free tool

Is your tracking actually working?

Paste your website into our free Tracking Checker. In about 20 seconds you’ll see whether GA4, Google Ads, the Meta Pixel and cookie consent are set up, and what’s missing.

Check my tracking Free. No sign-up.

Step 7: Test everything in Preview mode

Never publish without previewing. Click Preview in GTM, enter your site URL, and Tag Assistant opens your site in a new tab connected to GTM.

  1. Browse the site like a customer. Check your Google tag and Conversion Linker fire on every page.
  2. Submit a real test form. Confirm the lead tags fire once, on the success event, not on the button click.
  3. Click a phone number and an email link. Check the right tags fire.
  4. Refresh the thank-you page. If a conversion tag fires again, fix it.
  5. Try a page where nothing should fire and confirm it stays quiet.
  6. Open GA4 DebugView to see events arrive with the right names and parameters.

For Google Ads tags, Preview only tells you the tag fired. Check the conversion action status in Google Ads a day or so later as well. It should move to “Recording conversions”.

Person testing a website on a smartphone next to an open laptop
Test on a real phone as well as desktop. Mobile clicks and forms often behave differently.

Consent mode lets your Google tags adjust based on whether a visitor agreed to cookies. It uses four settings: ad_storage, analytics_storage, ad_user_data and ad_personalization. Google explains each one in its consent mode help page.

  • If you use a cookie banner: choose a consent management platform (CMP) that supports Google consent mode and has a GTM template. It sets the default state and updates it when someone clicks accept or reject.
  • If you get visitors from Europe or the UK: Google has stricter requirements for those users, so a proper consent setup matters.
  • If you are Australian-only: rules here are different, but privacy expectations are rising. Be upfront in your privacy policy about what you track, and get advice if you are unsure of your obligations.

Test consent too. In Preview mode, reject cookies and check your tags behave the way your banner says they will.

Step 9: Name, version and document your container

This is the boring part that saves you later. Six months from now someone will open the container and need to know what “Tag 14” does.

A simple naming convention

  • Tags: Platform, type, what. For example “GA4 | Event | generate_lead” or “GAds | Conversion | Quote form”.
  • Triggers: Type, what. For example “Page View | Thank you quote” or “Click | tel links”.
  • Variables: Type, what. For example “DLV | order_value” (DLV means Data Layer Variable).

Version notes and workspaces

  • Every time you publish, give the version a name and a one-line note: “Added quote form conversion, removed old UA tag.”
  • If more than one person edits the container, use separate workspaces so changes do not collide.
  • Delete tags you no longer use, like old Universal Analytics tags. Paused junk makes audits slow.

Our marketing glossary is handy if you are handing the container to someone less technical and need plain-English definitions.

Free download

GA4 + Google Ads Tracking Plan

A fill-in-the-blanks template for every conversion that matters: what it is, what it is worth, and whether it steers your bidding.

  • Fill-in template
  • 8 pages
  • Fillable PDF
  • Free
Get the free PDF See all downloads

Common mistakes

  • Installing GTM twice. A plugin and the theme both add it, and every tag fires double.
  • GA4 hard-coded and in GTM. Inflated page views and events.
  • Firing lead tags on button clicks. Counts attempts, not submissions.
  • Using “contains” for thank-you pages. Blog posts with “thank-you” in the URL start counting as leads.
  • No Conversion Linker. Google Ads under-reports conversions.
  • Publishing without Preview. Broken tracking can run for weeks before anyone notices.
  • Forcing GTM into Shopify checkout. Google does not support it. Use the app.
  • The agency owns the account. When you part ways, your tracking goes with them.
  • No version notes. Nobody knows what changed or why numbers moved.

How long it takes and what to expect

A basic setup on a simple WordPress site (container, install, GA4, Conversion Linker, two or three conversions, testing) usually takes a few hours for someone who has done it before. Add time for consent setup, enhanced conversions and cleaning up old code. A Shopify store, or a site with several forms, booking tools and phone tracking, can take a few days once you include testing.

What should you expect afterwards? Often, your reported conversions drop. That sounds bad, but it usually means double counting or junk events have been removed. A Melbourne online store I audited had purchases firing on the order status page every time a customer came back to check delivery. Once fixed, revenue in Google Ads finally matched Shopify. Google Ads bidding then needs time to adjust to the cleaner data, so give it a few weeks before judging campaign performance.

After that, GTM is maintenance, not a one-off. Check it whenever you change your site, add a form, switch booking tools or launch a new campaign type. Phone calls are the gap I see most often, so read our guide on how to track phone calls from Google Ads next if calls matter to you.

If you would rather have it done properly the first time, our Google Tag Manager setup service covers the container, tags, testing and handover, and we also handle GA4 conversion tracking as part of our wider Google Ads management. Or start with a free audit and we will tell you what is firing, what is missing and what is double counting.

FAQs

Is Google Tag Manager free?

Yes. The standard version of Google Tag Manager is free and covers everything a typical small or medium business needs. There is a paid enterprise version as part of Google Marketing Platform, but most businesses never need it.

Do I need Google Tag Manager if I already have GA4?

You do not have to use it, but it makes life easier once you track more than page views. GTM lets you add form, call and purchase tracking, Google Ads tags and other platforms without editing your site each time. Just make sure GA4 is only installed once, either directly or through GTM.

Can I use Google Tag Manager on Shopify?

You can use GTM on Shopify storefront pages, but Google does not support running Google tags inside Shopify’s custom pixel for checkout tracking. For GA4 and Google Ads purchase tracking, Google recommends the Google & YouTube app. Use GTM only for extra tools that the app does not cover.

What is the Conversion Linker tag and do I need it?

The Conversion Linker stores ad click information on your site so Google Ads can match conversions to the click that caused them. If you run Google Ads and track conversions through GTM, you need it. Set it to fire on all pages.

How do I know if my GTM tags are working?

Use Preview mode in GTM to watch tags fire as you browse and submit test forms. Then check GA4 DebugView or Realtime, and the conversion action status in Google Ads. A free tracking checker can also confirm the main tags are loading on your live site.

Will Google Tag Manager slow down my website?

GTM itself is light. What slows sites down is loading lots of heavy third-party tags through it. Keep your container tidy, remove tags you no longer use, and only add tools you actually look at.

Found this useful? Share it.

Find out where your growth is leaking.

A free, no-obligation audit of your SEO, AI search visibility, ads and website. Straight answers, no sales pitch.

Get your free audit

About the author

Director and Lead Consultant, Anahaw Media

John Conigliaro is the Director and Lead Consultant at Anahaw Media, a Perth digital marketing agency focused on performance. A Filipino-Australian digital marketer now based in Perth, WA, with more than 15 years’ experience across Singapore and Australia, he has led agencies in Australia on technical execution and growth strategy, founded a globally recognised eCommerce brand, and managed almost 300 campaigns, from small businesses to multinational brands, including Canon, Uniqlo, Benefit Cosmetics, Asiana Airlines, Changi Recommends, APM and Golfbox. He completed an MBA and a dissertation on Digital Transformation, holds a specialisation in Computer Applications from De La Salle-College of Saint Benilde (DLSU-CSB), and is also a consumer tech critic and publisher. His mission is to use his talent and passion for digital marketing to change businesses for the better, in how they win customers and how they build their brand.

Keep reading

Leave a Reply