If you’re managing a website, you know how important it is to track user behaviour, optimise your marketing efforts, and implement various tools like Google Analytics, Facebook Pixel, or other third-party tracking scripts. But instead of manually adding code to your site every time you need to set up a new tag, Google Tag Manager (GTM) comes to the rescue!
In this guide, we’ll walk you through how to install Google Tag Manager on your website so you can streamline your tracking and make your marketing process more efficient.
What is Google Tag Manager?
Google Tag Manager is a free tool that allows you to manage and deploy marketing tags (small pieces of code like analytics and tracking scripts) without having to modify your website’s source code directly. Instead of editing HTML files each time you want to add or change tags, you can use GTM’s interface to manage them easily. This makes it a powerful tool for marketers and webmasters alike!
Step 1: Create a Google Tag Manager Account
The first step is setting up your Google Tag Manager account. Here’s how you do it:
-
Go to the Google Tag Manager Website
Navigate to Google Tag Manager and log in using your Google account. If you don’t have a Google account, create one first. -
Create Your Account and Container
Once logged in, you’ll be prompted to create an account. Here’s what to fill out:-
Account Name: Choose a name for your account, such as your company name or project name.
-
Country: Select your country from the drop-down list.
-
Container Name: The container name should be the name of your website or project.
-
Where to Use the Container: Select Web as the platform.
After filling this out, click on Create. You’ll be asked to accept the terms of service – go ahead and click Yes.
-
Step 2: Install Google Tag Manager on Your Website
Now that you’ve created your Google Tag Manager account, you need to add the GTM code to your website. This process is easy, and GTM provides you with the necessary code to add to your site.
1. Get the GTM Snippet
After setting up your container, GTM will display two code snippets:
-
Head Code
-
Body Code
These are the pieces of code you need to install on your website. The first goes into the <head>
section of your website’s HTML, and the second goes immediately after the opening <body>
tag.
2. Add the Code to Your Site
Now, it’s time to add these code snippets to your website. How you do this will depend on the platform you’re using:
-
For WordPress Users:
If you’re using WordPress, the easiest way is to install a plugin like Google Tag Manager for WordPress by DuracellTomi. This plugin allows you to insert the GTM container ID without manually editing your theme files. Just install and activate the plugin, then add your GTM ID in the plugin settings. -
For Custom Sites:
If you’re working with a custom-built site, you’ll need to manually add the code. Open your website’s HTML files and:-
Paste the Head Code inside the
<head>
tag. -
Paste the Body Code immediately after the opening
<body>
tag.
-
Here’s an example of what the code looks like:
Make sure to replace GTM-XXXX with your actual GTM container ID.
Step 3: Publish Your Container
Once you’ve added the GTM code to your site, head back to your GTM dashboard. Click Submit to publish the container. This step makes your container live, so GTM can start collecting data from your site.
Step 4: Verify the Installation
You don’t want to skip the verification step! After publishing the container, you need to make sure it’s installed correctly.
1. Use Google Tag Assistant (Chrome Extension)
Google offers a browser extension called Tag Assistant, which allows you to verify whether GTM is installed correctly. Simply install the extension and enable it while browsing your site. If everything is set up correctly, the extension will confirm that Google Tag Manager is running.
2. Use Preview Mode in GTM
Google Tag Manager also has a Preview Mode, which allows you to see whether your tags are firing correctly. To activate this, click on the Preview button in the GTM interface, and it will show you the live debug console on your website.
Step 5: Start Adding Tags to Your Container
Now that Google Tag Manager is set up, you’re ready to start adding tags! Tags are snippets of code that execute on your site, like tracking for Google Analytics, Facebook Pixel, and other third-party services.
Here’s how you add a tag:
-
In GTM, click Add a New Tag.
-
Choose the type of tag (e.g., Google Analytics).
-
Configure the tag settings.
-
Set up triggers (conditions when the tag should fire).
-
Click Save and Publish.
Final Thoughts
Google Tag Manager is a game-changer for simplifying the management of tags on your website. With the steps outlined above, you can easily install GTM and start using it to improve your website’s performance. The ability to manage all your marketing tags from one central place means less code editing and fewer headaches.
Have questions or need help with specific tags? Feel free to reach out in the comments or check out Google’s documentation for more advanced features.
That’s it! With GTM up and running on your site, you’ll be in full control of your tags and tracking scripts. Let me know if you run into any issues, and happy tagging!