Google Tag Manager (GTM): Beginner's Guide
By Frankie Chan, Co-Founder · Updated 10 November 2026 · 15 min read
Jump to section
- What is Google Tag Manager (GTM)?
- Create a GTM account and container
- How to install GTM on your website
- Tags, triggers and variables
- Track WhatsApp button clicks with GTM
- Turn WhatsApp clicks into a Google Ads conversion
- Track Contact Form 7 submissions with GTM
- How to test tags with Preview mode (Tag Assistant)
- Publish a GTM version and roll back
- Where Consent Mode and Google tag gateway fit in GTM
- Why GA4 shows no data after installing GTM
- FAQ
- Want someone to check your tracking?
Google Tag Manager (GTM) is a free tag management tool from Google. You install one GTM container snippet on your website. From then on GA4, Google Ads conversion tags, the Meta Pixel and other tracking tags are added, tested and published inside GTM. Your developer does not have to edit the site each time. The screenshots below come from Kick Ads' own GTM container and GA4 property in the English interface. We took them in November 2026.
What is Google Tag Manager (GTM)?
GTM does not collect data itself. It decides which tag loads on your site and when. The tags inside the container do the collecting. The part most people find confusing at the start is how GTM, the Google tag, GA4 and Google Ads conversions fit together:
| Name | What it does | Where you set it up |
|---|---|---|
| Google Tag Manager | Manages every tag on your site through one container snippet | tagmanager.google.com |
| Google tag (gtag.js) | Google's tag that sends data to GA4 and Google Ads. It can sit directly on the site or inside GTM | GA4 or Google Ads, or a Google Tag in GTM |
| GA4 | Reports on visitors and events. Important events can be marked as key events | analytics.google.com |
| Google Ads conversion | The action Google Ads counts for reporting and Smart Bidding. It can be imported from a GA4 key event or recorded by a Google Ads conversion tag | Goals in Google Ads |

If you only use GA4 and Google Ads and rarely add new tracking, installing the Google tag directly is fine. If you run tags for Meta, LinkedIn and other platforms too, or keep adding buttons and forms to track, GTM is much easier to manage. Whichever you choose, do not load the same Tag ID both ways. That is the most common reason GA4 counts every page view twice.
Create a GTM account and container
Go to tagmanager.google.com and sign in with a Google account. Click Accounts at the top left, then Create Account at the top right. Under Account Setup, enter your company name and country. Under Container Setup, enter a container name (for a website, use its URL, such as www.example.com) and choose Web. Click Create and accept the Terms of Service (Help Center).

One container per website is enough. You do not need one per page. To add a container for another site, open the Accounts tab, click the More icon next to the account name and choose Create Container. We recommend opening the GTM account under your company's own Google account and adding your agency or developer as users. The container then stays with you if you change partners.
How to install GTM on your website
Once the container exists, click the container ID (it starts with GTM-) in the Workspace tab, or go to Admin > Install Google Tag Manager. Google's current instructions use a single snippet pasted as high in the <head> of every page as possible. The older install had a second noscript snippet placed after the opening <body> tag. Sites installed the old way do not need to be re-tagged (Help Center).

If your site runs on WordPress, Shopify, Wix or another platform, open the Install with a website builder or CMS tab in the same dialog, click Select your platform and follow that platform's integration steps instead of editing every page. To paste the code yourself, choose Install manually. Afterwards, enter your URL in the Test field and click Test to confirm GTM loads.
Tags, triggers and variables
A tag is code that runs, for example code that sends an event to GA4. A trigger decides when the tag runs: on a page load, a link click or a form submission. A variable is a value that tags and triggers use, such as the address of the page the visitor is on (Page URL) or the address of the link they clicked (Click URL). GTM has built-in variables for the common cases. You can also create your own, such as a Data Layer Variable that reads an order value your site passes in.

Once you have more than a handful of tags, names matter. We recommend the following naming practice: tag type - name of the app - detail. For instance, "Google Ads conversions - iOS - 2026-02 campaign" or "GA4 Event - WhatsApp - sitewide button". Open the container months later and you can still tell what each tag tracks.
Track WhatsApp button clicks with GTM
Many Hong Kong businesses take enquiries on WhatsApp. When a visitor taps the WhatsApp button, the conversation moves to WhatsApp and your site never shows a thank-you page. To see which ads bring enquiries, you track the click on that button. The four steps below assume GTM is installed and GA4 base tracking is in place.
1. Check the GA4 base tag
The container needs one tag that loads GA4. Kick Ads' container uses the Google Tag type with the GA4 data stream's G- Tag ID, fired on Initialization - All Pages so it runs before other tags (Help Center). Google's Help Center currently recommends a second route: under Tag Configuration, choose Google Analytics, then Google Analytics, and enter the same Tag ID (Help Center). Tag Manager's 12 October 2026 release note says containers can now send data straight to Google's measurement products without loading extra gtag.js (release notes). Use one route. Do not load the same Tag ID in the page source and in GTM.

2. Create a trigger that fires only on WhatsApp links
In Triggers, click New. Under Trigger Configuration choose Just Links, select Some Link Clicks, and set the condition to Click URL contains wa.me. Just Links only tracks clicks on <a> links (Help Center). Most WhatsApp buttons link to wa.me or api.whatsapp.com. If your site has both, use Click URL matches RegEx wa\.me|api\.whatsapp\.com.

The condition has to use Click URL, the address of the link that was clicked. Page URL is the page the visitor is on. That is always your own site, so a trigger set to Page URL contains wa.me will never fire. If Click URL is missing from the dropdown, enable the built-in Clicks variables on the Variables page first.
Some floating WhatsApp widgets open the chat with JavaScript and are not <a> links, so Just Links will miss them. In that case use an All Elements trigger with a Click Text or Click Element condition and confirm it in Preview.
3. Create the GA4 Event tag
In Tags, click New and choose Google Analytics: GA4 Event. Enter the same G- ID as the Measurement ID, set Event Name to whatsapp_click, select the trigger from step 2 and click Save (Help Center).

Give WhatsApp clicks their own event name. Our own site once sent WhatsApp and other button clicks as a single cta_click event with a parameter saying which button it was. That parameter was never registered as a custom dimension in GA4, so the reports could not separate WhatsApp clicks from the rest. GA4's enhanced measurement also logs clicks to other domains as a click event (Help Center), but that event covers every outbound link, so it is a poor stand-in for enquiries.
4. Mark whatsapp_click as a key event in GA4
After you publish the container, whatsapp_click appears in GA4's event list. Go to Admin, click Events under Data display, and click the star next to the event to mark it as a key event. If the event has no data yet, click Create event and turn on Mark as key event. Standard reports can take up to 24 hours to show it; Realtime shows it within minutes (Help Center).

For other events such as scroll depth, see our GA4 event tracking tutorial.
Turn WhatsApp clicks into a Google Ads conversion
There are two ways to do it. Pick one as the primary conversion.
The first is to import the GA4 key event. Link Google Ads and GA4 and turn on auto-tagging. In Google Ads, open the Goals menu, go to Summary, click + Create conversion action. Under Conversions on a website, click Edit data sources, tick your linked GA4 property, then pick whatsapp_click in the next steps. Data can take up to 24 hours to arrive (Help Center). Conversions created from the GA4 interface are set as secondary. Switch them to primary in Google Ads if you want them used for bidding.

The second is a Google Ads conversion tag in GTM. Create a website conversion action in Google Ads to get a Conversion ID and Conversion label. In GTM, add a tag, choose Google Ads, then Google Ads Conversion Tracking, enter both values and use the same WhatsApp trigger (Help Center). If the container already loads a Google tag on every page, you do not need a separate Conversion Linker tag (Help Center).
Set both up as primary and each click counts twice in the Conversions column, so Smart Bidding sees double the conversions. Primary actions feed the Conversions column and bidding. Secondary actions only appear in All conversions (Help Center). For counting, Google suggests One for leads and Every for purchases (Help Center). A WhatsApp click is an enquiry. With One selected, several taps after a single ad click count once.
A tap on the WhatsApp button does not mean the visitor sent a message. Compare the conversion count with the WhatsApp enquiries you actually received once a month. The full conversion setup is in our Google Ads conversion tracking guide.
Track Contact Form 7 submissions with GTM
Many Hong Kong small business sites run on WordPress, and their contact forms usually come from Contact Form 7. Contact Form 7 submits with AJAX, so the page does not reload, and GTM's built-in Form Submission trigger has trouble telling whether the form was actually sent. With Check Validation off, the trigger fires every time someone clicks submit, including when a required field is empty. With it on, it may not fire at all (Help Center).
Listen for Contact Form 7's own events instead. The plugin fires wpcf7mailsent after the form's email has been sent. It also fires wpcf7submit on every submission, including ones that fail validation, so that event should not be counted as an enquiry.
1. Add a Custom HTML tag that listens for wpcf7mailsent
In Tags, click New, choose Custom HTML and paste the code below. Set Triggering to All Pages and click Save.
<script>
document.addEventListener('wpcf7mailsent', function (event) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'cf7_submit',
cf7_form_id: event.detail.contactFormId
});
});
</script>
When a form is sent, this code pushes a cf7_submit event and the form ID into the dataLayer. Send the form ID only. Do not push names, email addresses or phone numbers into the dataLayer. Google's policies do not allow personally identifiable information to be sent to Google Analytics (Help Center).

2. Create a Data Layer Variable and a Custom Event trigger
In Variables, under User-Defined Variables, click New and choose Data Layer Variable. Enter cf7_form_id as the Data Layer Variable Name and name the variable DLV - cf7_form_id. Then in Triggers, click New, choose Custom Event and enter cf7_submit as the Event name.

If the site has more than one form, such as a contact form and a quote form, choose Some Custom Events and add the condition DLV - cf7_form_id equals that form's ID, so only the enquiry form is tracked. This is the numeric ID: the number after post= in the address bar when you edit the form in WordPress. It is not the seven-character code in the shortcode of newer versions. The surest check is to submit once in Preview mode and read the value in the dataLayer.
3. Create the GA4 Event tag
Add a Google Analytics: GA4 Event tag with the same G- Measurement ID. Set Event Name to generate_lead, add an event parameter form_id with the value {{DLV - cf7_form_id}}, and use the Custom Event trigger from the last step. generate_lead is a GA4 recommended event for someone who submits a form or a request for information (Help Center). Then mark generate_lead as a key event in GA4, as with WhatsApp clicks, and import it into Google Ads with the method in the previous section.

4. Test it in Preview mode
In Preview mode, submit the form twice. First leave a required field empty: cf7_submit should not appear in the left panel of Tag Assistant. Then fill the form in properly and send it. This time cf7_submit should appear, and the GA4 Event tag should be listed under Tags Fired. If the form shows its success message but there is no cf7_submit, check whether the Custom HTML tag fired on that page. Each test sends a real email, so tell whoever handles enquiries before you start.
How to test tags with Preview mode (Tag Assistant)
Before publishing, click Preview at the top right of the Workspace. Tag Assistant opens in a new tab. Enter your URL and click Connect. Your site opens in a new window showing Connected at the bottom right. Go back to Tag Assistant and click Continue (Help Center).
Tap the WhatsApp button on your site once, return to Tag Assistant and select that click on the left. The GA4 Event tag should be listed under Tags Fired. If it sits under Tags Not Fired, click it to see which condition failed (Help Center). You can also check the actual Click URL value for that click. A wrong condition usually shows up there at a glance.

Preview only works in the browser where you started it, so regular visitors never see unpublished changes. If Tag Assistant cannot connect, untick Include debug signal in the URL and try again.
Publish a GTM version and roll back
When Preview looks right, click Submit, choose Publish and Create Version, review the Workspace Changes, enter a Version Name and Version Description, and click Publish (Help Center). Since September 2026 the Submit page can suggest an AI-written version name and description (turn on Suggested version summary) based on your changes (release notes). Edit it into something a colleague will understand, such as "Add GA4 event for WhatsApp clicks".

Until you click Publish, every change stays in the workspace and the live site is untouched. When Preview shows data but the live site does not, this is the usual reason.
If a release causes problems, go to Versions, open the ⋮ menu on the last good version's row and choose Publish. Set as Latest Version in the same menu only copies that version back into the workspace. You still have to publish it. GTM keeps a publish history showing when each version went live and who published it.

Where Consent Mode and Google tag gateway fit in GTM
Consent Mode passes each visitor's cookie consent choice to Google. In basic mode, Google tags do not load until the visitor responds to your cookie banner. In advanced mode, tags load with consent denied by default and send cookieless pings until consent is given (Help Center). Google notes regional differences for the EEA, Switzerland and the UK. If you have visitors there or already run a cookie banner, make sure the consent state reaches the tags in GTM.
In GTM, go to Admin > Container Settings and, under Additional Settings, tick Enable consent overview. The Tags page then shows a Consent Overview where you can check each tag's consent settings. Your cookie banner tag should use the built-in Consent Initialization - All Pages trigger so consent is set before other tags run (Help Center).

Google tag gateway for advertisers serves your Google tag through your own domain's infrastructure, such as your CDN (Google for Developers). Start from Admin > Google tag gateway in GTM. Sites on Cloudflare can connect from inside the interface (Help Center), and Akamai, Fastly, Google Cloud and Amazon CloudFront were added during 2026 (release notes). Google says advertisers who set it up saw an 11% uplift in signals. That figure is Google's own data from April 2025 (Help Center). The Tag Manager Help Center also warns that turning it on changes how Google tags fire. If you use Consent Mode, check that your consent settings still apply. If your site already runs on Cloudflare, setup is light and it is worth testing.
Why GA4 shows no data after installing GTM
When we take over an account, the first thing we do is walk each main conversion through Tag Assistant. Most data problems come from one of these:
| Symptom | Common cause | How to check |
|---|---|---|
| GA4 page views suddenly double | gtag.js is already in the page source and GTM loads the same Tag ID, or GTM is installed twice | Search the page source for G- and GTM- IDs, and check whether a CMS plugin adds them |
| WhatsApp events stay at zero | The trigger uses Page URL instead of Click URL, or the button is not an <a> link | Tap the button in Preview and see whether the tag is under Tags Not Fired |
| Preview works, the live site has no data | The changes are still in the workspace | Check whether the live version in Versions contains the tag |
| Some visitors have no data at all | They declined cookies, or the default consent state is set too late | Open the Consent tab in Tag Assistant. "Consent not configured" means Consent Mode is not on the page (Help Center) |
| GA4 has data, Google Ads has no conversions | The event is not a key event, the accounts are not linked, auto-tagging is off, or the import is under 24 hours old | Check the conversion action's status under Goals in Google Ads |

For GA4 itself, including data streams and reports, see our GA4 essential guide.
FAQ
What is Google Tag Manager? Google Tag Manager is a free tag management tool from Google. You install the GTM container snippet once on every page. GA4, Google Ads conversion, Meta Pixel and other tags are then managed inside GTM.
Is Google Tag Manager free to use? Yes. GTM is provided by Google for free, so you can try it practically risk-free before deciding whether it fits your business.
What is the difference between GTM and GA4? GTM loads tags on your site and has no reports. GA4 analyses the data. The GA4 tag inside GTM sends events to GA4 and you read the reports there.
What is a GTM Container ID? It is the code that looks like GTM-TXAAA, used to uniquely identify each GTM container. Once the container tag code is added to your website, GTM is considered installed.
Does Google Tag Manager slow down my website? The GTM container loads asynchronously, so a slow tag does not stop other tags from firing. A container with many heavy tags, such as large Custom HTML tags, can still slow the page. Google recommends removing unused tags, triggers and variables to keep the container size down (Help Center).
I changed something in GTM. Why has my site not changed? Changes only reach the live site after you click Submit and then Publish. Saving a tag or testing it in Preview does not change the live site.
Want someone to check your tracking?
Complete the Paid Media Health Check and we will check whether your GA4, Google Ads conversions and WhatsApp tracking are recording correctly, then tell you which fixes to make first. If you would like us to run your Google Ads, you can also contact us directly.
About the author
Frankie Chan · Co-Founder, Kick Ads
Frankie is an ex-Googler and paid media strategist. He has managed Google Ads and Meta Ads for ecommerce and lead generation businesses across Hong Kong and Malaysia since 2017, working closely on strategy, reporting and client growth planning.