How to Add Google Tag Manager to Your Shopify Website: A Step-by-Step Guide
Adding Google Tag Manager (GTM) to your Shopify store allows you to manage all your tracking and marketing tags in one place. Follow these easy steps to get started:
Step 1: Create a Google Tag Manager Account
- Go to the Google Tag Manager website.
- Click on Create Account.

- Enter your account name (e.g., your business name).
- Choose your country.

- Under Container Setup, enter your website name and select Web as the target platform.
- Click Create and agree to the terms of service.

- Then, read the Terms and Conditions, check the box that says “I also accept the Data Processing Terms as required by GDPR”, and click “Yes” to agree to the Google Tag Manager Terms of Service.

Step 2: Copy Your GTM Container Code
- Once your account is set up, you’ll see your GTM container code.
- Copy both the script code (appears in the
<head>section) and the noscript code (appears in the<body>section).

Step 3: Add GTM to Your Shopify Store
- Go to Shopify Admin > Online Store > Themes > Actions > Edit Code

- In the left-hand sidebar, find and click on the theme.liquid file under Layout.
- This file controls the overall structure of your website.

- Paste the GTM script code you copied earlier into the
<head>section of the theme.liquid file. (This goes right before the</head>tag.)

- Paste the GTM noscript code into the
<body>section, just after the opening<body>tag then Click Save to apply the changes.

Step 4: Verify Google Tag Manager is Working
After installing the code, use the GTM interface’s built-in tester:
- Go to your GTM workspace.
- Click on the “Preview” button in the top right corner.
- A modal window will appear asking for your website URL (as shown in the image).
- Enter your site (e.g.,
https://yourdomain.com) and click “Test”.
This will open a new tab with your site and attempt to connect GTM’s debugger mode. If it connects successfully, you’ll see a Tag Assistant window showing all active tags and events firing.

Now you’re ready to add and manage tracking tags like Google Analytics, Facebook Pixel, or any other marketing tools using GTM.
This setup is easy to follow, and once GTM is added, you can implement various tags without needing to edit your website code again.
Hope that helps, if you need help with Bing or Google Ads, book a call with me or send an email to victor@victorserban.com
See you later :)