- Home
- Resources
- Blog
- Strategy & Data
- Google Tag Manager: how to set up conversion tracking
Google Tag Manager: how to set up conversion tracking
Gaetano Tantimonaco17 min read

IN SHORT
Google Tag Manager is Google's free tool for managing your website's measurement codes in a single container: GA4, Google Ads, Meta and the others. You install it once, then every conversion is set up with three elements: a tag (what to send), a trigger (when) and variables (with which data). The conversions that matter for an SME are forms, phone and email clicks and purchases. Before publishing, you check everything in preview mode, with cookie consent already connected.
Topic of our service Analytics & Data
The website is new and the campaigns start on Monday. Someone has pasted the Google Analytics code into the theme, a plugin has added the Meta Pixel, and the previous agency put the Google Ads tag on the thank-you page. After a month Google Ads shows 60 conversions and the CRM 25 enquiries (figures made up for illustration). Nobody can say which code counts what, or who put it there. It’s the situation we find most often when we open a new ad account.
The short answer: Google Tag Manager (GTM) is Google’s free tool that gathers all your website’s measurement codes into a single container. You install it once, then every conversion is set up with three elements: a tag (what to send and to whom), a trigger (when to send it) and variables (with which data). For an SME, the conversions to set up first are four: form submissions, phone clicks, email clicks and purchases. Before publishing, you check everything in preview mode, with cookie consent already connected.
I run campaigns on Google, Meta and LinkedIn, and bidding work is only as good as the conversions the platforms receive. This guide is the method we use to set up GTM before switching a campaign on.
What is Google Tag Manager and what is it for?
Google Tag Manager is a tag management system: a piece of code installed once on the website which, according to rules you decide, loads the codes for Google Analytics 4, Google Ads, Meta, LinkedIn and other tools. Changes are made from a web interface, without touching the website’s code each time.
For an SME, the practical advantages are three:
- One place. All measurement codes live in the same container, with readable names. When the agency or the website supplier changes, the list is right there.
- Less reliance on the developer. Adding a conversion or changing a rule doesn’t require a website release, as long as the site already exposes the data needed.
- Checks before publishing. Every change can be tried out in preview, and every publication creates a version you can go back to.
GTM doesn’t measure anything on its own. It’s a “postman”: it delivers data to GA4, Google Ads or Meta, which then count it and attribute it to campaigns. If the postman delivers the same letter twice, the platform counts two conversions.
Container, tags, triggers, variables and data layer: what are they?
These are the five concepts you need to read any Tag Manager setup.
| Element | What it is | Example |
|---|---|---|
| Container | The “package” installed on the site that holds everything else. Its ID starts with GTM- | The container for the company website |
| Tag | The code that sends data to a platform | GA4 event “generate_lead”, Google Ads conversion “Quote request” |
| Trigger | The rule that decides when a tag fires | Contact form submission, click on a link starting with “tel:” |
| Variable | A value that tags and triggers read | Click URL, order ID, basket value |
| Data layer | The space where the site writes data for Tag Manager | {event: "purchase", value: 120, currency: "EUR"} |
Container, triggers and variables
A container usually corresponds to one website and is created from tagmanager.google.com. It’s best to register the account to the company, not to whichever agency or freelancer happens to be involved.
The most common triggers are page view, click, form submission and custom events coming from the data layer. A special one, Consent Initialization - All Pages, fires before all the others: it’s the one the cookie banner relies on. Built-in variables (Page URL, Click URL, Form ID) must be enabled from the Variables menu; you create the others yourself, such as a Data Layer Variable that reads the value of an order.
The data layer
The data layer is a JavaScript object the site uses to pass information to Tag Manager. Google’s documentation asks for two precautions: declare it before the GTM snippet with window.dataLayer = window.dataLayer || []; and always add data with dataLayer.push(), never by reassigning it, because that would wipe out what was there.
It needs a developer, but it makes tracking stable: a trigger built on the text of a button breaks at the first redesign, an event written by the site when the form is actually submitted doesn’t.
How do you install Google Tag Manager on the website?
You create an account and a Web container, then copy two blocks of code into every page of the site. Google says to put the first one as high as possible in the <head> tag and the second immediately after the opening <body> tag. The second is the noscript version, for browsers with JavaScript disabled.
On WordPress, Shopify, Wix and other CMSs you can use the platform’s integration or a plugin instead of editing the theme by hand. That’s fine, as long as the GTM code is loaded only once: check there isn’t already an old container in the theme or in a plugin.
After installation:
- Take an inventory of the existing codes. GA4 tags, Google Ads tags or Meta Pixels inserted by hand in the theme, plugins or CMS need to be listed. If you recreate them in GTM without removing them from the site, you count everything twice.
- Create the Google tag. In GTM, add a tag of type “Google Tag” with the GA4 property ID (it starts with G-), on the initialisation trigger for all pages.
- Remove the duplicate codes from the site only after checking in preview that the new tags work.
The link between ad clicks and conversions is made by the Conversion Linker, which saves click identifiers in your domain’s cookies. Tag Manager’s guide points out that if a container loads a Google tag on every page, you don’t also need to add a Conversion Linker tag. If the Google tag isn’t present on every page, the Linker needs to go on all of them.
Which conversions should you set up first?
The ones that correspond to a real lead or sale: form submissions, phone and email clicks, purchases. Before opening GTM, it’s worth writing them down in a one-page measurement plan: conversion name, what triggers it, which platforms receive it, what value it has.
| Conversion | Recommended trigger | GA4 | Google Ads | Meta |
|---|---|---|---|---|
| Contact or quote form | Data layer event after a successful submission | generate_lead |
Primary conversion | Lead |
| Phone click | Click on a link starting with tel: |
custom event, e.g. click_telefono |
Secondary or primary conversion | Contact |
| Email click | Click on a link starting with mailto: |
custom event, e.g. click_email |
Usually secondary | Contact |
| Purchase | purchase event in the data layer on the confirmation page |
purchase |
Primary conversion with value | Purchase |
The names generate_lead and purchase are events recommended by GA4: some GA4 reports use them directly. Lead, Contact and Purchase are standard Meta Pixel events. For other events choose short, lower-case names with underscores, and keep them the same across all platforms.
Contact and quote forms
This is the most important conversion for lead generation and the one that breaks most often. There are three ways to capture it, from the most fragile to the most solid:
- Form Submission trigger. GTM listens for the form being submitted. The Check Validation option limits firing to successful submissions: if it’s switched off, the trigger fires on every attempt, even when the form shows an error (guide to the Form Submission trigger). It doesn’t work with many forms that send data without reloading the page or that sit in an iframe, such as those of several CRMs and booking tools.
- Thank-you page. A page view trigger on the URL
/grazie/. It works if the page can only be reached after submission; reloads and visits from Google inflate the count. - Data layer event. The developer adds a line to the form, at the point where submission succeeds, such as
dataLayer.push({event: "form_inviato", form_nome: "preventivo"}). In GTM you create a Custom Event trigger onform_inviato. This is the solution we recommend, because it follows the real submission and not the look of the page.
If the form is in an iframe from an external service, check whether that service has a GTM integration. If it doesn’t, it’s often better to record the conversion from the CRM, as we explain in from lead to contract: connecting campaigns and CRM.
Phone and email clicks
You use a Click - Just Links trigger with the condition “Click URL starts with tel:” (or mailto:). The built-in Click URL variable must first be enabled in the Variables menu. A trigger like this covers every number and address on the site, including the ones in the footer.
A click isn’t a phone call: it’s an intention. That’s why, in the campaigns we run, an email click almost always stays a secondary conversion, and a phone click only becomes primary when the phone really is the channel customers come through. To measure real calls from ads you need different tools, such as Google’s forwarding number: we cover them in the article on call ads.
E-commerce purchases
Here the data layer is mandatory. On the order confirmation page the site must write a purchase event with transaction ID, value, currency and products, in the format given in the GA4 e-commerce guide for Tag Manager. The same guide recommends clearing the ecommerce object before each new event, so that data from a previous step doesn’t get mixed in.
The most popular e-commerce platforms have extensions that do this automatically. They still need checking: value with or without VAT and shipping, cancelled orders, external payments that don’t return to the confirmation page.
How do you set up tags for GA4, Google Ads and Meta?
With one tag per platform and per conversion, all hooked to the same trigger. The same “form submitted” event feeds GA4, Google Ads and Meta: if the form changes one day, you update a single trigger.
GA4
For each conversion you create a Google Analytics: GA4 Event tag with the property ID and the event name (generate_lead, click_telefono, purchase). For purchases, in the tag settings you switch on sending e-commerce data with the data layer as the source. Then, in GA4, you mark the events that count as key events: that’s the name GA4 now uses for what used to be called conversions.
Google Ads
In Google Ads you create the conversion action and, in the tag setup, choose Google Tag Manager: you get the conversion ID, the same for the whole account, and the conversion label, different for each action. In GTM you create a Google Ads Conversion Tracking tag with these two values. Tag Manager’s guide suggests adding value, transaction ID and currency code through variables, and reminds you that if the value is left empty, 0 is sent. The transaction ID is there so the same order isn’t counted twice.
Alternatively, you can import GA4 key events into Google Ads, though they have different timings and attribution rules. Don’t use both routes as primary conversions for the same form.
In the Google Ads tag you also switch on user-provided data for Enhanced Conversions. We won’t repeat here how it works: it’s all in Enhanced Conversions and Consent Mode, including the advice to pass the email from the data layer rather than from CSS selectors.
Meta
The Meta Pixel in GTM is set up in two parts. The base code, copied from Events Manager, goes on every page (a Custom HTML tag or a template from the Community Template Gallery). The standard events (Lead, Contact, Purchase) are separate tags on the same triggers used for GA4 and Google Ads. For Purchase, Meta requires value and currency.
In Events Manager, Meta also offers an automatic integration with Google Tag Manager. We prefer to create the tags by hand: you know exactly what fires, and you don’t give an external platform permission to edit the container.
If you also use the Conversions API, that is sending events from the server, every Pixel event must have an eventID identical to the event_id sent by the server. Meta deduplicates the two events only if the name and ID match and they arrive within 48 hours. Without a shared ID, every lead counts double.
How do you connect Consent Mode v2 in Tag Manager?
With the consent management platform (CMP) template on the Consent Initialization - All Pages trigger, which sets the four Consent Mode signals to denied before any other tag and updates them when the visitor makes a choice. For many CMPs there are ready-made templates in the Community Template Gallery, as the guide to consent in Tag Manager points out.
Within GTM there are then two levels of control for each tag, in the advanced settings:
- Built-in consent checks. Google tags (GA4, Google Ads, Floodlight) read the consent status on their own and change their behaviour accordingly. Nothing else needs adding.
- Additional consent checks. For third-party tags, such as the Meta Pixel or LinkedIn’s Insight Tag, you set “Require additional consent for tag to fire” and specify the signals required, usually
ad_storage. That way the tag fires only if the visitor has accepted.
The Consent Overview (switched on from Admin, Container Settings) shows on one screen which tags have consent configured and which don’t. It’s the first place we look when we open an inherited container.
The differences between basic and advanced Consent Mode, the requirements for conversion modelling and the rules of the Garante (the Italian data protection authority) are explained in the article on Enhanced Conversions and Consent Mode. The choice between basic and advanced should be agreed with your DPO.
How do you check everything works before publishing?
With Tag Manager’s Preview mode. From the workspace, click Preview, enter the site’s URL and Tag Assistant opens, connected to a tab of the site with the draft container active. According to the guide to preview mode, for each event you can see which tags fired, why, and what data they sent. The draft is only visible in your browser until you publish.
The round of checks we do before every publication:
- Banner open: no third-party tag fires before the choice is made, and consent shows as denied.
- Cookies accepted: the consent update appears and the waiting tags fire.
- Form with an error: no conversion.
- Form submitted correctly: each conversion tag fires once only, with the right parameters.
- Phone and email clicks: one conversion per click.
- Test purchase: transaction ID, value and currency correct in the data layer.
- Cookies rejected in an incognito window: third-party tags stay put.
Then you check from the other side: GA4’s DebugView for events, the Test Events tool in Meta’s Events Manager for the Pixel and, after a few days, the status of the conversion action in Google Ads.
How do versions and publishing work?
Every publication creates a version, that is, as Google defines it, a snapshot of the container’s configuration at that moment. You publish with Submit, then Publish and Create Version, giving it a name and a description (guide to publishing and versions).
Three habits avoid a lot of problems:
- A name and description that make sense. “Quote form: data layer event + Ads + Meta” says what changed. “Version 14” doesn’t.
- One change at a time. With ten changes together you can’t tell which one broke what.
- Knowing how to go back. From the Versions section you can republish the good version and fix things calmly.
In the free version each container has up to three simultaneous workspaces, useful when the agency and the developer are working in parallel. The approval workflow before publishing is only available in Tag Manager 360, the paid version: for an SME it’s enough to decide who has permission to publish.
After publishing, wait a few days and compare the conversions in the platforms with the leads that actually came in. The method is in the article on how to check data from click to sale.
Do you need server-side tagging?
For many SMEs, no, at least at first. With server-side tagging you add a second GTM container running on a server you control: the browser sends data to that server, which forwards it to GA4, Google Ads or Meta. It gives more control over what leaves the site and makes it easier to send server-side events, such as Meta’s Conversions API.
However, it has infrastructure and maintenance costs, and it makes sense when there are lots of platforms to feed or strict data requirements. Consent must be respected on the server side too. First you want a tidy web container: a server-side setup built on the wrong events sends wrong data in a more sophisticated way.
Mistakes to avoid
Duplicate codes between the site and GTM. Tags left in the theme or a plugin and recreated in Tag Manager: conversions double and campaigns look better than they are.
Conversions on an unprotected thank-you page. Reloads, bookmarks and visits from Google inflate the numbers. A data layer event at the moment of submission is better.
Triggers tied to the design. Button text or CSS classes: at the first redesign the tracking stops without warning.
Third-party tags without consent checks. Google tags handle consent on their own; the Meta Pixel and the others don’t. They have to be configured one by one.
Two primary conversions for the same form. The Google Ads tag and the GA4 import both used for bidding: Smart Bidding sees twice as many enquiries.
A GTM account registered to someone who’s leaving. The container must belong to the company, with at least two internal people with administrator access.
Checklist
- Account registered to the company, duplicate codes removed, Google tag on every page
- Written measurement plan: conversions, triggers, platforms, values
- Forms tracked with a data layer event after a successful submission
- Clicks on
tel:andmailto:tracked with click triggers purchaseevent with transaction ID, value and currency (for e-commerce)- GA4, Google Ads and Meta tags connected to the same triggers
- CMP on the consent initialisation trigger, additional checks on third-party tags
- Preview test with consent accepted and rejected
- A clearly named version and a comparison with real leads after two weeks
Want a tidy Tag Manager before investing in campaigns?
We start with a check of the container and the site: duplicate codes, conversions that don’t fire or fire twice, consent, links with GA4, Google Ads and Meta. Then we write the measurement plan, set up the tags and test them with you before publishing. It’s the work we do in our analytics and data service, usually before switching on campaigns on Google Ads or Meta.
You can book a call with Federico or write to us via the contact form.
Frequently asked questions
Is Google Tag Manager free?
Yes, the standard version is free and is enough for almost every SME. There’s a paid version, Tag Manager 360, with features for large organisations such as a publishing approval workflow and more workspaces.
What’s the difference between Google Tag Manager and Google Analytics?
Google Analytics measures and displays data: visits, channels, key events. Tag Manager doesn’t show reports: it manages the codes that send data to GA4 and other platforms. They’re usually used together, with GA4 configured through Tag Manager.
Do you need a developer to use Tag Manager?
Not to install it or manage basic tags and triggers. You do need one for the data layer, that is to have the site write reliable events such as a successful form submission or purchase data. It’s a well-defined job that makes tracking more stable.
Can I move the codes I already have on the site into GTM?
Yes, and it’s advisable. You recreate each code in Tag Manager, check in preview that it works, and only then remove the old one from the site, so that you don’t lose data or count it twice during the switchover.























