24 Oct How to implement Google Tag Manager from scratch
On the recent Google Analytics Summit (1st October,2013), Google announced few exciting features, which one of them is the update on Google Tag Manager – Auto Event Tracking. This updated enable you to perform some of the event tracking without the need to customise tracking and work with the coding.
But before going deep into those exciting new features of Auto Event Tracking, we first look at the basic on what, why and how to use Google Tag Manager
What is Google Tag Manger?
Quote from Google:
Google Tag Manager(GTM) allows you to conveniently manage tags (such as tracking and marketing optimization tags) on your site. You can add and update AdWords, Google Analytics, Floodlight and non-Google tags from the Google Tag Manager user interface instead of editing site code. This reduces errors, frees you from having to involve a webmaster, and allows you to quickly deploy tags on your site.”
Google Tag Manager Intro
Basic Terminology of GMT
The top-most level of organization. Typically, only one account is needed per company. Tags for all the company’s websites can be managed from this account by creating new containers.
A container holds all the tags for a specific website; as mentioned above it should be named after the website it is being used for.
Why you should use Google Tag Manager?
Benefits that you should use Google Tag Manager
- It’s free
- Avoid Redundant code or missing code on specific page
- Time saving as IT team and marketing team can work together
- Non-IT users can add tags from the build-in tag template
- Multi-platforms are available – mobile sites & mobile apps
- Easy testing allowing marketer to test and debug the verify the tags
- Handle multiple websites’ tags easily in one single platform
How can you use Google Tag Manager?
It is a free tool that available to all Google account users, you can get access to it by using your existing Google account or create a new one.
3-steps Google Tag Manager Setup Process
Give your account a name, e.g. your company name, team name etc
Create a container name, typed in the site URLs and configure the time zone.
Add the container code to your site just after the <body> tag. You need to include this coed in every single page on your website.
Tip 1: How to paste the code the every single page?
You do not need to copy and paste this code to the site page by page.
For Beehive Strategy, as a WordPress site, it’s simply that the theme provides an easy setup on Asynchronous Analytics.
If you are not using WordPress or your theme does not provide this easy setup, you can still implement the code using PHP.
Above is part of coding of header.php, paste the code after <body and you should be able to implement the code across the site
And, you’re done with the basic setup, Hurray! You can now kick the IT buddies out and work on your own! (Just kidding, please be nice to your helpful and nice IT buddies…as you may probably need them very soon :D)
Tip 2: How do you know the tag is working fine?
Using chrome plug-in called “Tag Assistant by Google”, you can simply view all the tags within your site.
Let’s try to create a Google Analytics tag for testing then.
Most of you may have the similar situation with Beehive Strategy site that the traditional Google Analytics is already implemented on the site.
Note: Google highly recommended webmaster to emerge all the tags into GTM Platform, meaning that old tags should be removed while implement all the new tags using GTM.
We are thus going to implement Universal Analytics Tracking tag for Beehive Strategy
Click “Create a new tag” button to make a tag
Step 2 Input the required information
And you should input the required information.
For simplicity, here we use Page View as track type. Other options like ecommerce or event tracking are available for the track type and we will discuss it in advance implementation guide later.
Tip 3: You can find your own tracking ID by logging in your Google Analytics Account:
Admin à Property à Property Setting
Since we want to activate the tag on all our pages and once the page is loaded. Here is the default rule using Regular Expression (RegEx) matching all pages.
(There is some advance setting available but we will leave it now.)
Is this all done? No, it is still unpublished status. You will either take a testing or publish it immediately.
Step 3 (Optional) Preview the tag and debug
And go to the site URL
Step 4 Publish your tag
After testing and make sure everything works, you can apply this changes to the site by simply clicking “Create Version” to save your action and “Publish” to make it live.
Now go back to Beehive Strategy and take a look on a deeper page – Digital Analytics and Reporting tag assistant.
It’s working! Grab a drink and relax yourself a little bit (though still a long journey to go)
How to pause the tag?
But what if you want to stop the tag “working”? Maybe the rule is not correct, you want to stop it first and take a deeper look into it.
It’s simple, goes back to the GTM and creates a new version with rule removed, and it will no longer fire the tags as there is no rule. You may re-define the rule and test it again until all fine.
Next time, we will talk more about advance implementation on GTM like advanced settings on different tags, defining new rules and data layers to track more sophisticated user behavior.