Understanding the basics of Google Tag Manager
With Google Tag Manager, you can track a wide range of user interactions to better understand and improve your website’s performance.
However, if your tags aren’t set up correctly, your analytics efforts will be rendered worthless.
By the end of this tutorial, you'll have a solid understanding of how to make the most of GTM and what your business should be tracking.
Is Google Tag Manager easy to use?
Absolutely! Google Tag Manager (GTM) is built to be user-friendly, making it a great tool for marketers and website managers who aren't coding experts.
Its intuitive interface makes managing tags straightforward, and you can add HTML/JavaScript tracking to your site without writing any code.
While there is a bit of a learning curve with more complex setups – thankfully, there are plenty of tutorials and community forums to guide you and we’re here if you need help taking your GTM to the next level.
Learn more about the benefits of Google Tag Manager for your business.
![illustration of man with code surrounded by tag icon types](https://cdn.sanity.io/images/7j7xebvw/production/287115ab446d0c6db4a2995219fc99a5ee6b27ac-2500x1500.jpg?w=1500&h=900&auto=format)
What should I track with Google Tag Manager?
What you need to track the most will largely hinge on the type of business you have. For example, an e-commerce site might focus on tracking product views and purchases, while a publishing website would prioritise tags that measure engagement, like scroll depth.
Regardless of your industry, here are some key actions you should consider tracking:
- Page Views: Essential for basic analytics.
- Clicks: See what links, buttons, or images get the most attention.
- Form Submissions: Monitor when users submit forms, particularly useful for conversion tracking.
- Video Engagement: Track how users interact with video content, like plays, pauses, or completions.
- Scroll Depth: Measure how far users scroll on your pages to gauge content engagement.
- E-commerce Activities: Track product views, additions to cart, and purchases to analyse e-commerce performance. This should be a must, in our opinion, as you want to track your money to the cent.
Remember: always test your tags in the Preview section to make sure they’re firing correctly before you go live! We also strongly recommend checking what your GA4 is tracking to avoid doubling up tags.
Learn more about how GA4 and GTM work together.
How to create a variable in Google Tag Manager
Now that you know what you need to track, let’s move on to setting up a variable in Google Tag Manager.
A variable isn’t a tag itself, but it plays a crucial role in storing information that your tags and triggers use to function correctly. Here's how to create one in 5 easy steps:
Step 1: Click “Variables” on your Google Tag Manager homepage
Step 2: Under “User-Defined Variables”, click “New”
![Screenshot of variables on Google Tag Manager homepage.](https://cdn.sanity.io/images/7j7xebvw/production/0dd742edf6edf8e351d4c488ebcc25610027661c-2416x1220.png?rect=0,1,2416,1219&w=1500&h=757&auto=format)
Step 3: Name your variable
For this tutorial, I've named mine “GA Tracking ID” so I’d remember. Once you've entered the name, click the “Variable Configuration” box.
Step 4: Pick a variable type
Choose “Constant” as your variable type since you don’t want the ID to change for different tags.
![Naming a variable and picking a variable type in GTM](https://cdn.sanity.io/images/7j7xebvw/production/35119e4180dd88a411d8d0e1c415ab4e21f68e8a-2826x974.png?w=1500&h=517&auto=format)
Step 5: Save your settings
Finally, input your Google Analytics Tracking ID number into the “Value” box and hit “Save” at the top right.
![Screenshot of Value box in GTM's Variable Configuration window](https://cdn.sanity.io/images/7j7xebvw/production/8d52819827a02601ee67a2aaa5ab05e4a809d499-2080x1140.png?w=1500&h=822&auto=format)
How to create a GA4 Event tag
You've just laid the groundwork by creating your variable and now it's time to bring your tracking to life by creating the Event tag itself.
Step 1: Create a new tag
Click “New Tag” or “Add New Tag” and give your tag a descriptive name, like "GA4 Button Click Event".
![Google Tag Manager home screen](https://cdn.sanity.io/images/7j7xebvw/production/81dcba405160c96882733d70ec16db70b21f620a-1705x715.jpg?w=1500&h=629&auto=format)
Step 2: Choose your tag type
Select “Google Analytics: GA4 Event” as the tag type. It's good practice to use the latest version, so choose Google Tag (New).
![How to choose your tag type in GTM Tag Configuration](https://cdn.sanity.io/images/7j7xebvw/production/ef946e65500767d300de7fe45273720eafbf33f4-1834x849.jpg?w=1500&h=694&auto=format)
Step 3: Configure the tag
If you already have a GA4 Configuration tag, select it. If not, enter your Measurement ID.
Name your event (e.g., button_click) to specify what action you're tracking.
Step 4: Add Event parameters (Optional)
Want more details? Add parameters like button_name: {{Click Text}} to pass the button's text as a parameter.
Step 5: Set the trigger
Under “Triggering”, select the trigger you created for button clicks to determine when the tag should fire.
![How to choose your trigger type in GTM](https://cdn.sanity.io/images/7j7xebvw/production/b11822768d3ab6f7bf1dba612b0961fda781dc61-1834x1047.jpg?w=1500&h=856&auto=format)
Step 6: Save and test your tag
Save your tag, then click “Preview” in GTM. Go to your website and click the button to ensure the tag fires correctly. You should see the event in the GTM preview pane and later in the GA4 real-time report.
Step 7: Publish your changes
If everything looks good in Preview mode, go back to GTM and click “Submit” to publish your new tag and trigger configuration. Name the version, describe the changes, and click “Publish”.
How to edit a tag and change its value
Finally, let’s bring everything together by editing the “TestTag1” you just created and including the new variable you made earlier in this post.
Step 1: Choose a tag to edit
From your GTM homepage, select “Tags” from the sidebar. Click on the tag you want to edit (in this case, “TestTag1”).
![How to edit a tag on the GTM homepage](https://cdn.sanity.io/images/7j7xebvw/production/d3c4c3caab90ca2a7442993341a84e0a1c25e56d-1938x928.jpg?w=1500&h=718&auto=format)
Step 2: Add the new variable
Click the grey “+” icon next to the “Web Property ID” box.
![](https://cdn.sanity.io/images/7j7xebvw/production/310bc010c8ea52d04e410a71e119ad08ecc24251-1878x901.jpg?rect=1,0,1877,901&w=1500&h=720&auto=format)
Step 3: Select your variable
A “Choose a variable” box will pop up. Select the first option, which will be the variable you created earlier, in this case, “GA Tracking ID.”
![Choosing a variable in GTM](https://cdn.sanity.io/images/7j7xebvw/production/f8dff644c0e489615b75713c6fa17cdb069866ad-1957x616.jpg?w=1500&h=472&auto=format)
Step 4: Save your changes
Now, your tag’s “Web Property ID” should display the variable name you selected. Click save, and your tag is updated!
![Web Property I.D in GTM's Tag Configuration](https://cdn.sanity.io/images/7j7xebvw/production/42bb3f686d10f7cf7d1bca83506a4dfe7ea45c22-1962x967.jpg?w=1500&h=739&auto=format)
Congratulations
Well done! You've learned the basics of how to set up Google Tag Manager and empowered your website with powerful tracking capabilities. Whether you're monitoring clicks, form submissions, or engagement metrics, accurate data collection is now at your fingertips.
Conclusion
If you don't have the resources to wrap your head around GTM, leave it to us! At Indago Digital, analytics are our bread and butter and our experts are here to help ensure your data works harder for your business.
Book in a chat with our Chief Data Officer, Preet Singh today.
Written by
Towfiq Ahamed