Google Tag Manager Setup

A small lesson in setting up your Tag Manager Account and creating Event tags for Google Analytics.

Harry Winton
Aug 8, 2017 · 9 min read

Measuring traffic for your website can be a major pain, especially when it comes to Google Analytics (GA). Sure, setting up GA is simple at first, after all, you only need to sign up for an account, and copy and paste a different tracking codes for your different websites. However, setting that up doesn’t give you a wider picture of what areas of the site users are clicking on.

If you have social media icons, accordion html links, videos, or any clickable content on your page that you want tracked, all of those needed elements are left out of the default GA tracking code. To allow those individual elements to be tracked, the GA code must be manipulated with an event tag. This is a task that most developers could easily do. However, the trouble is the time consuming nature of setting many of those tags up. Furthermore, if you are constantly adding new aspects to a site, communication between the marketing department and technology department could be challenging.

This is why Google created Tag Manager a platform that allows the more technically inclined marketers and data analysts to easily manipulate tracking code without ever having to touch a code editor. However, understandably, there is a bit of a learning curve when it comes to utilizing it. Today, I will be walking you through how to set up your Google Tag Manager account, link it to your GA account, and go over some basic elemental setups.

Setting Up your Tag Manager Account

Thankfully the initial creation of a Tag Manager account is easy.

First you go onto your Gmail account and go to the Tag Manager page and hit Create Account in the upper left corner.

Next to type in what you would like to name your container. Often something like your company’s name or the product you are trying to promote is most appropriate.

Next, you will be asked to put in your web URL and select whether your code will be on a website, an iOS app, an Android app, or an AMP (short for Accelerated Mobile Page for mobile friendly content, something that we can go over in another article). For the sake of simplicity, and not having to utilize SDKs, we will be using Tag Manager a website.

Finally a pop-up will appear that will ask you to enter in the Tag Manager tracking code. One will be on as high on the <head> tag as possible and one will be immediately after the opening <body> tag. Even though these instructions are simple, it is heavily advised that you allow your web developer to enter in this code. This is because the tracking code could potentially create bugs in other areas of the website if not properly placed. The good news is that after the implementation of this tracking code, you will never have to bug your web developer again for basic changes to your analytics.

And voila, your Google Tag Manager account is set up. However, the interface is confusing as heck! What is a tag? What is a trigger? What are variables? Where do I even begin? Trust me, when I first started this, I was confused as well. Rest assured, as you follow along in linking Tag Manager to your GA account, and setting up your event tags, all of your questions will be answered.

Linking Tag Manager to GA

As cited by Google, tags are essentially snippets that allow you to send information to a third party. For example, with HTML everything surrounded in <> is called a tag because it is sending that information to a browser so it can be translated and displayed for users. However, with Google Tag Manager, these third parties aren’t browsers. Most of these are analytics interfaces such as Google Analytics, AdWords, SalesForce, and even your own custom data areas if you are so inclined. The point is, a tag gives third party data information for them to do with it as it will.

In this instance, we will be linking Tag Manager to GA. In order to do this, the first thing you need to do is create a new tag by clicking the New button. Make sure you title that tag to be something easily remembered, for example I like to title my initial GA tag “General Google Analytics Tag”.

Next, you will be asked to select from a variety of third parties. For GA, click on Universal Analytics, select Page View as a type, and have your GA Tracking ID ready.

Next, enter in your GA Tracking ID and follow along the instruction, clicking false if your website does not have eCommerce features, cross-domain tracking or any of the other ideas listed.

Finally, you will be asked to input a trigger. A trigger is the condition that is set that allows the tag to send information to the third party. For example, you will want Page View information to be sent and displayed in GA every time someone enters your site, leaves your site, or hops from page to page in your site. This is why the All Pages trigger exists as a default on Tag Manager. It allows the tag to fire each time a user enters and leaves your pages. So, make sure you set the trigger to “All Pages”.

Once you hit save, your tag will be saved temporarily into your Work Space. However, it will not be fully submitted immediately for good measure. The next thing you will want to do is preview your new tag. In order to do this hit the “Preview” button.

You can now view and see if your tag fires correctly. In order to do this, just enter the URL of the site you have linked to Tag Manager. Once you do so, you should see a small window appear at the bottom of your site that indicates which tags fired and which tags did not. If your tag did not fire and you have no idea what went wrong, please consult your developer.

Otherwise, if you are all set, go ahead and click submit on the Tag Manager interface and you will be all set with creating your first tag!

Creating Elemental Triggers

Now that you have linked your Tag Manager account to your GA account, it is time to create your first Event tag. However, in order to do that, you must first create your elemental trigger. In order to do that, go to the toolbar, click Triggers and then click the New button.

Next you are going to want to click on the Trigger Configuration pane. Following that, you will need to choose the trigger type called “All Elements” under the Clicks section.

Once you do that, you are going to want to change the trigger firing conditions from “All Clicks” to “Some Clicks”. Afterward, you will notice a drop-down that asks for which condition the trigger will fire the tag.

Now, you may be asking yourself, how do I know what conditions I should make to allow this trigger to fire? Well, in this circumstance we are going to allow this trigger to fire every time someone clicks on our Facebook icon. In this circumstance, first enter Preview Mode (as described above) and enter your site. Once you enter, look at the window below and take notice of the far left tool bar on it. Then, click on the Facebook icon.

Once you do that, return to your site and you should find an action called gtm.click. This indicates that you took some action on a page. Click on the gtm.click section and then click on variables tab on the top of the bottom window.

You will now notice a list of different variables that help differentiate the Facebook icon from other elements on the page. In this instance, the largest difference is the “Click Classes” variable that uses the term “icon-facebook” this variable is what is going to help you filter out this event from other events.

Return to Tag Manager and back to configuring your trigger. Under the Some Clicks conditions, change the variable to “Click Classes” and allow it to fire if the term contains (or is equal to, or starts with, or ends with, whatever makes you most comfortable) “icon-facebook”. After that, give you trigger a distinctive name (ours is “Facebook Icon Click Trigger”) and save it.

Create your Event Tag

Finally, at long last, it is time to create the Event tag that will help you track where users are clicking on your web page. The first thing you are going to want to do is start by creating a new tag, select Universal Analytics and change the track type to Event.

Next, you are going to want to label your Event Tracking Parameters. You will want to label the Event Category something obvious that will allow you and other users to know what event is occurring in GA. In this instance labeling it “Facebook Button Clicks” is more than adequate. Next, enter the type action that leads to this event. In this instance, “Click”. Finally, you will enter your Event Label. In this instance, enter in {{Page Path}}. Doing this will allow you to view the page where the Event click occurred.

Once you are finished, find the window below that indicates the trigger. Click on the trigger that you made for your Facebook icon. After that, name and save your new tag. Remember to make it something that distinguishes the action taken.

Finally, preview your tag on your website. Pay extra special attention to the tags that do not fire when you click on the Facebook icon. If more or less than one tag is firing, then go back and make sure that you followed the steps correctly in creating the Facebook trigger. If that doesn’t work, consult your developer.

Now you are all set. Make sure to click submit and name your update. This is vital or else you may have to start all over. With that, you have just started creating your own Event tags on Google Tag Manager. If you didn’t already know this and learned it from here, congratulations!

Of course, there are unanswered questions to utilizing Tag Manager such as differentiating which Facebook icons were clicked (in our case, was the header icon clicked, or the footer icon?), utilizing it for form submissions, and utilizing timed intervals. These elements are important to Tag Manager and will be explored another time. In the meantime though, feel free to check out the lessons from Google. Happy Tagging!

Further Reading:

4Thought Studios

A collection of articles and musings of a small app development company.

Harry Winton

Written by

SEO fanatic, The Room enthusiast, and a curious observer.

4Thought Studios

A collection of articles and musings of a small app development company.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade