In my quest to understand how to properly set up and use Google Tag Manager, I found answers by piecing together bits and pieces from several different sources. It was a frustrating process and it took me a long time to figure out how to make things work (and I still have a LOT to learn!).
With this series of blog posts, I will attempt to explain – using simple, step-by-step instructions – how to set up and use Google Tag Manager to track events and goals on your website.
So first off, I will do my best to answer the question: How do I set up Tag Manager on my website?
1. Go to: https://tagmanager.google.com/ and login with your Google account – or create a new one if you don’t have one already.
2. On the Tag Manager Dashboard, click ‘Create Account’:
3. On the Next page, give the new account a name (A) – usually the name of the business that owns the website. Click ‘Continue’ then enter the domain name (B) – do not include ‘http://’. Click the ‘WEB’ button (C) and then click the ‘CREATE’ link (D):
4. The next page will have the Tag Manager codes you need to add to your site. Copy the top code (A):
and paste this code into the ‘Head’ section of your site’s web pages. The ideal spot for the code is just before the closing </head> tag (‘A’ below). If you use WordPress or another CMS (Content Management System), you can do this in your ‘header.php’ template file:
if your site is pure HTML, then you will need to add this code to the same area of your web pages, you’ll just need to do it for each page on your website.
5. Now copy the second snippet of code from Tag Manager (B):
and paste this code just after the opening <body> tag (B) in your ‘header.php’ template file (depending on your CMS) or into all of your static HTML pages:
6. Click ‘OK’ in Tag Manager, then click ‘Variables’ in the left menu:
7. Under ‘User-Defined Variables’, click ‘NEW’:
8. Give your new Variable a new title – call it ‘Analytics’ (A):
9. Click the ‘Variable Configuration’ area (‘B’ above), then scroll down a bit and choose ‘Google Analytics Settings’ (‘A’ Below):
10. Go to your Analytics account and load up the dashboard for the site you are working on. At the bottom left, click ‘ADMIN’:
11. In the ‘Property’ column click ‘Tracking Info’ (A), then, click ‘Tracking Code’ (B):
12. Highlight and copy the ‘Tracking ID’ (A):
13. Go back to Tag Manager and paste the ‘Tracking ID’ into the corresponding field (A), then click ‘SAVE’ (B):
14. Now click ‘CONFIGURE’ in the ‘Built-In Variables’ section:
15. From here you can activate all built-in variables available. Here are the ones I recommend activating:
- Under ‘Clicks’ (A):
- Click Element
- Click Classes
- Click ID
- Click URL
- Click Text
- Under ‘Forms’ (B):
- Form Element
- Form Classes
- Form ID
- Form URL
- Form Text
16. Close the ‘Configure Built-In Variables’ tab (C above).
And there it is – a (hopefully) simple step-by-step guide showing you how to create a Google Tag Manager Account and install it to your website.
My next post will cover how to create Triggers in Tag Manager – until then, happy tracking!