How to implement Google Tag Manager (GTM)
What is Google Tag Manager (GTM)
Google Tag Manager is a free tool that allows webmasters/developers to manage and deploy marketing tags on the website and mobile app.
Why use Google Tag Manager
You can manage all tracking code from different platforms in one place without having to modify your code. That means you do not need a developer to help you add any code on your website.
Different platforms such as
- Google Analytics tracking code
- Adwords Remarketing code
- Adwords Conversion Tracking code
- Heatmap tracking code (Hotjar, CrazyEgg, etc…)
- Facebook pixels
GTM has a version function, so every time you implement a new update, it will save as a new version. Therefore if you did something wrong in this current version, you can row back to the previous working version.
If I am currently running my GA code (Hardcoded) can I implement GTM too?
Yes, you can!!! When GTM code that been “first” generated, it is just a container, it contains no setting in the container. Even after you added the code on your website, it will do nothing at all.
My recommendation is if you have implemented a lot of tracing event using GA code let just stick with it. If not then I would suggest you migrate it to GTM for better managing all your tracking in one place.
I not saying you cannot use both GA and GTM together, all is up to you. In short, don’t complicate your implementation process else your data will be messy too.
Let say, if you are the only person who is managing the site you might know which implementation goes where. What if your developers/webmasters change every few years and it might be very confusing and take time for new developers/webmasters to figure out what goes where.
How to install Google Tag Manager
I will assume that you already have a Google account.
- Now go to Google Tag Manager and log in.
- Once you log in, click the “Create Account” button on the top right.
- Now fill up all the field
– Account name
– If you are willing to share your data with google, then check the box.
– Container name – key in your domain name
– Select your target platform
- A term of service agreement box will pop up. Read it, check the box and click yes.
- After that, you will be redirected to the dashboard page. For the first time, you will see two sets of codes appear in front of you. Now you need to copy this code into every page of your website. (You just need to do it once.)
- Open your website, place the first set of code under the <head> tag.
- For the second set of code, place it after the <body> tag.
- After you have added the code and uploaded it to the server, go back to your Google Tag Manager dashboard and click “Submit”.
- Give your first version a good name and description so you can track what you have done in the current version. Then click publish.
Now you have implemented an empty Google Tag Manager container. In the next tutorial “Add Google Analytics and Facebook Pixel in Google Tag Manager“, I will show you how to add tags to your container.