Create a Google Tag Manager Account
To start, visit Google Tag Manager. If you already have an account, you’ll see your existing containers. If not, follow these steps to create one:
Click Create Account.
Enter your account name (e.g., your business name).
Choose your country and specify whether you’d like to share data with Google.
Under Container Setup, enter your website’s domain name.
Select Web as the container type (unless you’re setting up for an app or server-side tracking).
Click Create and accept the Google Tag Manager Terms of Service.
Once you create your container, GTM will provide you with two snippets of code that must be added to your website.
Add Google Tag Manager Code to Your Website
Adding GTM to Shopify
If you’re using Shopify, follow these steps to add GTM to your store:
Login to Shopify and navigate to Online Store > Themes.
Find your current theme and click Actions > Edit Code.
Locate the theme.liquid file under Layout.
Find the
<head>
section and paste the first GTM code snippet just below the opening<head>
tag.Locate the
<body>
tag and paste the second GTM code snippet immediately after it.Click Save to update your theme.
⚠️ Caution: You are editing live theme files. If you’re not comfortable making code changes, consider seeking help from a developer.
Adding GTM to WordPress
For WordPress users, there are two ways to install GTM: manually or via a plugin.
Method 1: Manual Installation
Login to WordPress and go to Appearance > Theme File Editor.
Open the header.php file and paste the first GTM snippet just below the
<head>
tag.Open the footer.php file (or locate the opening
<body>
tag in header.php) and paste the second GTM snippet immediately after it.Click Update File to save changes.
Method 2: Using Site Kit by Google (Recommended)
Install the Site Kit by Google plugin from the WordPress Plugin Directory.
Navigate to Site Kit > Settings.
Under Tag Manager, connect your GTM account by entering your container ID.
Site Kit will automatically inject the GTM code into your website without needing manual file edits.
This method is safer for non-technical users and ensures GTM remains active even after theme updates.
Test and Verify Your GTM Installation
After installing GTM, you need to verify that it’s working correctly. Here’s how:
Open Google Tag Manager and select your container.
Click Preview in the upper-right corner.
Enter your website’s URL and click Connect.
If GTM is installed correctly, a success message will appear in Tag Assistant.
Another way to check your setup is to use the Tag Assistant Legacy Chrome Extension, which shows whether GTM is active on your site.
Troubleshooting Common Issues
If your GTM container isn’t detected, try the following:
Clear your website cache (especially for WordPress users using caching plugins).
Disable ad blockers or tracking prevention settings in your browser.
Check for conflicting scripts that may be interfering with GTM’s functionality.
If you continue to have issues, consider consulting a developer for assistance.
Final Thoughts
Google Tag Manager makes it easy to manage tracking tags without editing your website’s core code. Whether you’re using Shopify, WordPress, or another platform, this guide ensures you have a smooth setup.
If you found this guide helpful, feel free to leave a comment or reach out for further assistance. Happy tracking!