Google Tag Manager (GTM) is a free tag management system (TMS) offered by Google that simplifies the process of adding, editing, and managing tags (snippets of code or tracking pixels) on your website or mobile app without requiring direct changes to the code.
Key benefits of using GTM
- Efficiency: Centralized management of all your tags in one place, saving time and reducing errors.
- Agility: Easily add or update tags without involving developers, allowing for quicker marketing campaigns and A/B testing.
- Collaboration: Enable teamwork by setting user permissions and access levels.
- Flexibility: Supports various tag types, including Google Ads, Analytics, third-party vendor tags, and custom tags.
- Built-in features: Provides features like error checking, debugging, and version control for improved tag reliability.
- Free to use: GTM is accessible to businesses of all sizes at no cost.
How it works:
- You add two small snippets of GTM code to your website’s HTML.
- You create tags, triggers (conditions that cause tags to fire), and variables (data used by tags) within the GTM interface.
- GTM handles the deployment of tags on your website based on the defined triggers and variables.
How To Add Google Tag Manager On My Website
1. Create a GTM Account and Container
- Head to Google Tag Manager and sign in with your Google account.
- Create a new account for your website or organization.
- Within the account, create a new container specifically for your website.
- Choose the ‘Web’ container type as we are adding GTM to a website.
- Agree to the terms of service and create the container.
2. Install the GTM Code on Your Website
You’ll get two snippets of code from GTM:
- Snippet 1: Goes in the
<head>
of every page on your website, ideally as high in the<head>
as possible. - Snippet 2: Goes immediately after the opening
<body>
tag on every page.
How to add the code depends on your website
- Content Management System (CMS) like WordPress: Many CMSs have plugins that simplify GTM installation. Search for and install a reputable GTM plugin, then enter your GTM container ID in the plugin settings.
- Custom Website or No Plugin Available:
- Access your website’s codebase.
- Open the main template file that controls the structure of all your pages (often named
header.php
,index.php
, or similar). - Paste Snippet 1 into the
<head>
. - Paste Snippet 2 right after the opening
<body>
tag. - Save the file and upload it back to your server.
3. Verify Installation
- Use Google Tag Assistant (a Chrome extension) to check if GTM is installed correctly.
- Preview your container in GTM to ensure it’s firing tags as expected.
Additional Notes
- Google Analytics: Once GTM is set up, you can manage your Google Analytics tag through GTM instead of hardcoding it on your site.
- Other Tags: GTM allows you to manage various other marketing and analytics tags from one central location, making it easier to update and maintain.
Remember
- Always back up your website files before making any changes.
- Test thoroughly after installing GTM to ensure everything is working correctly.