Google Tag Manager is a tag management tool that helps website owners manage and put many complicated tracking code tags easily on the website without having to ask the developer.
This article will show you how to install Google Tag Manager in Shopify. Why does every Shopify store need to use Google Tag Manager?
Google Tag Manager is a complicated tool for many first time users. However, it is worth the effort because of the following 3 important reasons.
- It will help you measure user engagement metrics (click, scroll depth,..) that don’t have in default in Shopify Analytics or Google Analytics. Most importantly, you don’t need to know anything about coding to use Google Tag Manager.
- It helps you speed up your site. If you need to use many 3rd party tracking apps like Hotjar, Crazy Egg, managing them only through GTM can save up a lot of website resources when a user is loading. Thus, it makes your site load faster.
- Despite Shopify’s Analytic support measuring conversion rate, add to cart, and many more helpful other metrics, it's not intuitive and flexible as using on Google Analytics dashboard.
How to install Google Tag Manager in Shopify?
Preparation
In order to install Google Tag Manager, your website first needs to have installed Google Analytics. If you don’t know how to do it, you can check it here.
Next step, you need to sign up your account with Google Tag Manager in here (incase you don’t have one)
Now, we will walk you through 2 methods for installing Google Tag Manager in Shopify.
Method 1: Add Google Tag Manager via theme code
Step 1: Get Google Tag Manager Snippet code in the admin dashboard.
Go to Admin > Install Google Tag Manager > Copy the code below.
Step 2: In your Shopify Admin, go to Online Store > Themes. In your current themes, click on Actions > Edit code.
Step 3: Go to Layouts > theme.liquid. Then, copy the selected code near the top of <head> tag. Right after <meta> tag is optimal.
Step 4: Copy the second code snippet in GTM:
Into this location - Right after <body> tag
Hit “Save” and you're done. You have add Google Tag Manager in Shopify Store
Note:
- This method does not add GTM into your checkout page if you are Shopify Basic users
- If you are a Shopify Plus user, you need to redo all of these steps again to the file: checkout.liquid if you want to add GTM to checkout pages.
Read more:
Method 2: Add Google Tag Manager via Google Analytics setting
If you want to add GTM to the checkout page even if you are a Shopify Basic/ Advanced user, this is a method to go.
Step 1: Get Google Tag Manager Snippet code in the admin dashboard.
Go to Admin > Install Google Tag Manager > Copy the code below. (must exclude the <script> </script>
Step 2: Go to Online Store > Preferences > In Google Analytics section, click Add Custom Javascript, then add the copied code in the field box.
Step 3: Go to Online Store > Themes > Actions > Edit Code > Layouts > theme.liquid
Copy the second code snippet in GTM:
Into this location - Right after <body> tag
Hit “save” and you are done.
Verify after setting up
Despite which method you use, you need to verify the tag after setting up. You can easily do that by using Tag Assistant Legacy on Google Chrome.
Once you’ve installed that, open your website and click on the Tag Assistant Legacy icon then enable the tag
Refresh the page and click on the extension again.
If you see a green tag for Google Tag Manager, then installation was successful.
Final word
Google Tag Manager is a must-have tool if you want to improve your Shopify Business overtime. We hope through this article, you have learned how to add Google Tag Manager on Shopify.
If you have any questions, don’t hesitate to reach out to us through the contact page.
Subscribe to our email or follow us on Facebook, Twitter or Linkedin now for more valuable Shopify news, tutorials as well as eCommerce’s growth hacks to boost your business.
-----
Boost Commerce is a technology company that is helping more than 11,000 Online Stores Across 80+ Countries grow sales with Shopify Advanced Filter and Search app.