What you will learn
- Explain how tags, triggers, and variables work together
- Set up a GA4 event for a button click in Google Tag Manager
- Test tracking with Preview mode before publishing
Google Tag Manager is a free tool for adding and managing tracking codes, called tags, from one place. A developer installs the GTM container code on the site once. After that, a marketer can add the Google tag for GA4, Google Ads conversion tracking, the Meta Pixel, and other tags without editing the website each time. Every change is saved as a version, so mistakes can be rolled back.
GTM works with three building blocks. A tag is the code that sends data, such as a GA4 event. A trigger decides when the tag fires, such as when someone clicks a link starting with wa.me or reaches a thank-you page. A variable holds information the tag or trigger needs, such as the click URL or page path. For example, you might send a GA4 event named whatsapp_click whenever a WhatsApp link is clicked.
Never publish without testing. Preview mode opens your site with Tag Assistant connected, showing which tags fired on each action. Check that the event also arrives in GA4's DebugView. If the site has visitors from regions with consent rules, such as the European Economic Area or the UK, set up a consent banner and Google consent mode so tags respect each visitor's choice. Publish with a clear version name.


