How to Set up GTM (Google Tag Manager) for Magento 2
Want to integrate GA4 into your Magento 2 Store?
Make more informed and data-driven decisions by setting up GA4 in Magento 2.
Are you tired of managing tags on your website or looking for a better way to manage them?
Then, Google Tag Manager is the simplest solution to this problem. Using this tool, you can manage all the tags without getting pulled in different directions.
If you are new to Google Tag Manager or don’t know how Magento 2 Google Tag Manager works, or need help adding Google Tag Manager to Magento 2. Then, don’t worry. I will guide you through. 💡
I recommend reading this blog to the very end because, in the end, you will have a clear idea on:
- What is Google Tag Manager?
- Why do Magento 2 Store Owners Need to Use GTM?
- How does Google Tag Manager Work?
- How to Add GTM (Google Tag Manager) For Magento 2 Websites [Step-by-Step]
What is Google Tag Manager?
Google Tag Manager (GTM) is a free tool developed by Google that allows Magento 2 store owners to manage and deploy marketing tags, and there is no need to make changes in the code.
Managing tags without a tag management system is very time-consuming and difficult. It can take away your productive hours from your schedule. According to Google, the Google Tag Manager (Also known as GTM) helps to make tag management simple, easy, and reliable by allowing marketers to deploy website tags all in one place.
At times, store owners get confused between Google Analytics and Google Tag Manager.
- Google Tag Manager simply collects the data of the user’s actions on the website, but it doesn’t analyze it. It is a tag management tool.
- Google Analytics is the tool that analyzes the data and provides detailed reports on the users’ actions.
🔗 Learn more: Google Analytics 4 (latest version)
Why do Magento 2 Store Owners Need to Use GTM?
If you have a large Magento 2 store, you need to add GTM for your Magento 2 site because your website needs to update tags weekly or monthly. If the tags are improper, it can often slow down your website.
GTM also makes many activities smoother with Google Ads and analytics, opening the door for many possibilities.
How does Google Tag Manager Work?
The Google Tag Manager works in three phases. Let me break it down to help you understand better:
- Tag – Here, the GTM notices the event on your website. These tags keep an eye on the activities on your page.
- Trigger – When any action triggers on a particular event, the tags get fired, and GTM stores the action with the needed information.
- Variable – Variable goes specific. You can get to know the specific action taken on the site with detailed information.
🤝Also read: How to Add Facebook Pixel to Magento 2
What are the Advantages of Adding Google Tag Manager for Magento 2?
Google Tag Manager plays an imperative role in your Magento 2 store. Keeping all your tags stored in one place is one of the roles, but it does come with the following advantages:
- Completely free-to-use tool
- Event tracking
- Debug features
- Permission management
- Easily works with Google Analytics
- You can integrate it with various content management tools
Now that you know the basics of Google Tag Manager. Let’s understand how to add Google Tag Manager to Magento 2
How to Add GTM (Google Tag Manager) For Magento 2 Websites [Step-by-Step]:
1. Create a Google Tag Manager Account
Getting started with Google Tag Manager. Click on “Start for free.” After logging in with your Gmail account, you must create your Google Tag Manager Account. Write down your account name, country and select the target platform. Then, click on create.
2. Get the GTM Code
There are two sections in the code. For the first one, you need to paste in the header section, and for the second one, you must paste in the body section of your Magento 2 website.
3. Add Google Tag Manager code in Magento 2
Open your Magento Admin Panel and move to Content > Design > Configuration > Edit the Store View > Other Settings> HTML Head. Paste the code you got from GTM for the <head> tag here.
4. Add the code in the footer section
Now move to Footer and paste the GTM code for <body> under the “Miscellaneous HTML.” And Click Save Configuration.
5. Check GTM from the front end
Go to the front end to check if Magento 2 Google Tag Manager up. Open the home page and click CTRL + U to open view source. Find GTM, and you can see the code. And the GTM is successfully added!
Here are some helpful tools for you:
- Google Tag assistant chrome extension to check for the proper Google Tag Manager for Magento 2
- Magento 2 Google Tag Manager extension to simplify the management of GTM tags.
Conclusion
Google Tag Manager is essential for e-commerce websites because the website gets updated on a daily basis, and GTM does automatic tag updates. You can use this blog as a simple checklist to add Magento 2 Google Tag Manager. Also I would like to recommend you to set up an staging environment. This allows you to test any updates or changes without risking disruption to your live site.
I hope I was able to help you with this process. If you have questions, please ask in the comment section below. I would love to answer your question.
Thank you for reading!
Shivbhadrasinh Gohil
Shivbhadrasinh is the Co-founder & Chief Marketing Officer at Meetanshi. He leads the marketing team and is the person behind the marketing & branding success of the company. Being a seasoned digital marketer, he has been consulting online businesses for growth since 2010 and has helped 100+ clients with digital marketing success.
He loves sharing tips and insights about the latest digital marketing trends aimed at helping online business owners.
Prev
How to Enable CAPTCHA for Admin Login in Magento 2
How to Create a New Customer Account from Magento 2 Admin Panel
Next