Special

Goals, Events And Google Tag Manager – How To Track Like A Boss

In previous posts I have shown you how to track affiliate clicks with Google Universal Analytics.

However this method is completely “code based” and doesn’t consider the idea to track goals and funnel things that are really useful if you really want to optimize your marketing, campaign and conversion.

Looking around there are many useful tutorials about Google Analytics Goals and Funnels but most of them are really hard to understand and many are based on old interfaces.

Also sadly on-line I haven’t found any good tutorial that teach you the new GTM 2015 interface, so in this tutorial I’m going to make all those things much easier to understand.

What You Will Learn In This Article:

    • What a Goal is
    • How to set up a Goal
    • What a Funnel is and how to configure it
    • What is a Google analytics event
    • What is the new Google Tag Manager
    • How to set up your first Tag
    • The difference between a GA and GTM Eventt

Coming Soon:

In my next article I will teach you in more depth how to setup more advanced goals and events in the Tag Manager.

In order to do that we will need to understand better how to verify the code using Chrome add-ons and verify how things work.

Last but not least we will learn how to setup Google Analytics Goals to interact with the Tag Manager to create advanced tracking methods.

So, let’s start from the basics and let’s track our conversion like a pro.

This tutorial is for those who already know what Google Analytics (GA) is, and want to improve their website’s performance.

You just need to have Google analytics installed on your website and understand how to navigate it.

Don’t forget to subscribe to get my next post on Tag Manager straight to your inbox!

Goals and funnels

So what is a Goal? First of all let’s understand what a Goal does before I show you how to set up your own easily.

A Google analytics Goal produces this:

Google Analytics Goal

As you can see in the image, it shows you how many conversions happen on any given situation, you decide. (Goal Completions)

In this case each goal is triggered when a user hits the specific Thank-you.php page, or whichever page you decide to setup.

This means that if you want to track people subscribing to your newsletter or you want to track websites transactions, you can easily view all of the data inside Google Analytics.

You just need to tell to Google Analytics which pages trigger a goal.

Google Analytics also shows you which pages they hit before to perform specific actions.

You can also setup a value for each goal so you can monitor the results of your marketing efforts.

Goal Funnel

So as I said here I will not show you how to track complex e-commerce actions because this involves a different level of knowledge.

We can however see how to track some interesting things that are useful for your marketing, which will help you to understand better what happens on your site.

How To Set Up A Goal

Setting up a goal is really easy.

You can track as many as 20 goals on your account and this is done by simply telling Analytics which specific page you require to fire the goal.

Remember that you can create a Goal and still modify it as you need, but you cannot delete it. Once you create your first goal you can use it for test purposes.

That’s not as bad as it seems but I suggest that you only use one or two goals in the initial test.

You can still change them in order to test different setups until you are comfortable with the process.

For test purposes, if you are not familiar with the process, I suggest you set up a test account in Google Analytics first and then move to the production one once you are ready.

Track A Basic Form Submission In Google Analytics With Goals

Tracking a basic newsletter subscription is simple, we want to track the destination page that the subscriber reaches when they submit the form.

To do that, you need to first go on the Admin section of your Google Analytics account and then click on Goals:

step-1-admin-section-goal

Now click the New Goal button

Fill in the name field with the title you choose and click on which kind of goal you want.
In this example we will chose “Destination” to setup a destination page as a trigger for our goal.

Setup Window

Now choose “page is equal to” and fill it in with the path of the destination page that the user will reach after submitting your form.

You don’t need to fill it with the entire URL, but don’t forget to write the / in front of the page.

Goals-Details-Filed

You can turn on the “Give a Value” option and set a monetary value for each conversion.
Google will track the earnings in a given period of time for you.

If you want you can choose to use a funnel, this means that you can tell Google to fire the goal only if all the funnel steps are completed.

Choosing this means you force the goal to trigger only if the first page has been visited, if you don’t choose this then the goal will be triggered, even if the visitor starts from a different page.

We don’t need to track a funnel at the moment, so keep it off for now.

And finally save the goal.

Test The Goal

The simplest way to test a goal is to see directly the results.

To test your goal you just need to go to ‘Analytics Realtime’ in your subscription form, submit it and then go back to Analytics Realtime.

Here you will see the page view and if you go on the “Conversions” menu you will see whether your goal has been triggered.

Test Goals in GA Realtime Analytics

If you want to see the entire goals tracking for a given period you just need to go in the “conversion” menu and you can find the overview and more analysis.

conversions overview

With this method you can track almost every kind of conversion, you just need to set up each page you want to see the conversions for in Google Analytics and it will keep track for you.

As you can see in the goals set up, you can set up page views as a destination for your goal and also other goal trigger.

You can set up the visit duration as a goal, how many pages per session and also events as a trigger for your goal.

When using events as a trigger you can do many really amazing things. The Google Tag Manager will help you a lot with this and I will show you that in more depth in the next article.

goal-setup

For now let’s keep to basics. For example, if you want to know what a marketing campaign is doing you can set up a goal with a funnel.

How to activate funnel

In this case you can set up a landing page as required to trigger the goal by activating the required switch.

This will force Google to trigger the goal only when the people that subscribe to your list land first on the specific page you set up.

To complete the goal basics, if you set up a category on your admin section in Analytics when you go to the goal setup panel, you will find some goal templates to use.

category-tamplate-analytics

But you can always access the custom goal set up by choosing “custom”.

how to setup custom tempalte analytics

Easy right?

Let’s move on to the next step.

Tips:

If you want to test your webform using tools like Aweber or Getresponse, each time you submit your email they will tell you that you are already subscribed.

Also if you use the same email each time you cannot easily recognize whether the form destination is working or not.

To escape this issue if you use a Gmail account you can use different emails only using one account.

Let’s say that your email is youremail@gmail.com you can put a + sign and add some comments after it.

In Google it will be directed to your inbox instead.

Example:

youremail+SidebarSubscriptionTest1@gmail.com and you can follow with as many comments as you need.

Goal Funnels And Tags.

Goals are amazing, simple to use and easy to set up but goals aside there are other methods to track actions on your websites and those methods are called events.

What Is An Event?

I find that events are more useful than goals.

Events give you more or less the same information as goals but they are treated in a different way and give a different report.

They are not limited in number either so you can setup as many events as you want.

With these it is easier to track clicks on links, on forms, play buttons and more. For this reason you can use them in a different way to goals.

To use this you will inform Google Analytics “when something happens, record an Event within these parameters” and as parameters you can insert everything that helps you to track the events.

Basically, an Event provides four types of data:

A category, an action and a label. If you want you can also give an event a value.

event-data

 

I previously wrote a post on how to track events with Google Analytics; in this I demonstrated how to use them by embedding a code in your template.

Now we will see how to use them thanks to Google Tag Manager or GTM.

For example, if you want to track an affiliate click you can tell Google analytics to receive an event within these parameters:

Category: Affiliate Clicks
Action: Name of the affiliation
Label: URL of the page where the link has been clicked.

This is just an example but it should give you an idea.

In this way, you can see where the link has been clicked, what link and which kind of link it was.

As you can see, an Event allows you to collect information under categories which can contain various different actions, which again can contain many labels. Understanding this allows you to use events for a lot of applications.

Also, the winning combination is to use both together, which I will show you in a future post.

For now let’s understand how to use events, not using code but using the new interface of Google Tag Manager.

Google Tag Manager

gtm

Google tag manager (GTM) is a tool that Google puts online to allow anyone who doesn’t know how to code to activate events on their site.

Basically, it is a place where you say to Google, if you see “this” happen on my page, fire an event.

What’s “this”?

“This” is an example of an action, when you click on a link, a form submission or a page view. If you learn how to code it you can track so much more.

Every day they are implementing new actions to track, so soon everything will be easy to do just by using the GTM interface.

GTM allows you to do many things but for now this is what we really need to know.

When an event is fired in GTM you will see it later in Google analytics as the events we saw before.

When we fire a page with GTM you will see it in Google Analytics as a virtual page.

It is a little bit more complex than setting up a goal but if we do it slowly step by step you will love it.

Fire An Event In Google Tag Manager

First of all we need to understand what it means to fire an event in GTM.

The best way to do it is to break the ice by creating an account, it should only take a couple of minutes.

To create an account, follow these steps:

1) Log in into your Gmail first (or your Google account).

2) Once you are ready, follow the link and set up an account: http://tagmanager.google.com/

3) Once you are in the GTM account set up, select a name for your account. You can choose the name you prefer and hit continue.

create-account

Next you need to give a name to the container.

Generally, it is better to put the url of your website here, or the name of the website, because each account can contain more websites and a Container contains a website.

If you want to setup a mobile version of your website for example, you can create a new container.

setup-account

You can also create new containers for each different website you own.

Once that’s done you will be in the GTM main window:

Tag-Manager_account_overview

Using this method you are now already subscribed to the new interface and ready to use it.

If you have the old interface, don’t worry.

There is a link on the upper right that allows you to switch to the new interface, and soon all accounts will be migrated to the new UI.

I suggest the use of the new interface because in 2015 all old accounts will be migrated, so it is a great idea to get a head start.

If in error you create an old account you can easily set up a new one in seconds and delete the old one with no problem.

The new interface allows you to work as easily as the old one in my opinion.

Once you are subscribed GTM shows you a pop up window with the new code to copy and paste in your website to track the code.

Trigger Creation

It is basically the same as when you set up the Google Analytics tracking code.
You only need to input it once and then it will last forever.

Here’s how to do it if you don’t know how:

You need to insert it after the tag <body> of all the website pages. You will probably have to send it to your IT or, if you know how to edit files, you can insert it for yourself.

If you use WordPress you don’t need any code, because there is a plugin to do it for you.

Use this plugin for WordPress: https://wordpress.org/plugins/duracelltomi-google-tag-manager/

All you need to do is install it and then move under the admin area of the plugin like in the picture below:

Google tag manager wordpress plugin

You can find your account ID in the upper part of your Google Tag Manager screen.

Copia di where-to-find-tag-id

Once the plugin is activated you just need to set your GTM ID (Google Tag Manager ID) and hit save.

How GTM Works

GTM seems really complicated, and there are many places where they explain how it works in the most complicated way possible.

To make a great set up you honestly don’t need to know very much about it because tracking the most common and important things doesn’t require a huge amount of knowledge.

In a future article I will show you how to use it like a pro and how to test the code directly in the browser, how to create advanced events, virtual pages setup etc.

For now let’s try to understand the basics.

Google Tag Manager: The basics

Google Tag manager is made by 3 main components.

Tags – Triggers – Variables

In the old interface trigger there were Rules and Variables, they were Macros.

Trigger

A trigger is simply something based on what happens on your website, and when it is “activated” it fires a Tag.

TAG

The tag is the part that performs an action, generally to send an event or a “page view” to Google Analytics.

The trigger works using GTM events. They are basically invisible to you, and they are not the same as Google Analytics events.

Basically, when someone on your website clicks or submits a form, this will be interpreted by GTM as an event and it will activate the trigger that fires the Tag.

Variables

And variables are just Variables. They contain information about events in your website (we will see them better later).

Let’s setup a fast example.

Let’s say that you want to track clicks on your website and generate an event each time someone clicks somewhere.

You need to send Google Analytics an Event with the information inside telling it that the Event is a Click.

You will setup a Tag with all the click information inside like the link url, the page where the user clicks the link and what kind of link it is.

And then you will set up the trigger to activate this tag.

When the tag is fired you will find all this information in Google Analytics just like magic!

To do this, follow these steps:

1) Click “New” to create a new Tag

create new tag

2) Choose the Google Analytics Tag (GA TAG)

2-click-google-analytics

3) Choose the kind of account you are currently using in Google Analytics. In most cases it is Universal analytics, this is the new kind of analytics account. If you have an old account choose classic Google analytics.

3-choose-universal-analytics

4) Next you should chose the trigger to fire the Tag. For this example we will use “Click”.

4-click-trigger

5) Once you choose click, a pop up window will appear asking you to create a Trigger. In this case choose “all clicks” and then click continue.

Create the trigger

6) Give a name to the trigger and choose which kind of trigger you want to track. Here we will track all the clicks, not just the links. If you only want to track the links just select Links Click.

Name the trigger

7) Now hit the Create a Trigger Button.

Create a trigger button

8) You have just setup a trigger. Now you should finish the Tag with the analytics and Event information.

Name the tag

9) To finish you need to set up the Tag. You need to give the Tag a name and fill in your Google Analytics Tracking ID. This is mandatory if you want Tag Manager to send the data to your GA Account.

9-setup-the-tag-1

10) Now we need to fill out the event information that will be passed to the Google Analytics account as events.

In the Category field we will need to fill out a name. Here I will name it ‘Generic Click’ and in the “Action” field I will set up the variable name as Page URL. In this way each time a click occurs the event will track the current page.

10-fill-event-information-

11) Next set up a Label of the event, the second variable. Select Click URL to track the link clicked.

11-setup-clickURL

12) To finalize the Tag creation hit the Create Tag button.

Create a tag

13) And now we are ready to test our Tag. From here you can create a draft of the Tag and test it before publishing it. At this point we will publish it to test in Real Time and see what happens.

13-click-publish

14) Now if you go on your website and click on a random link, you will see in your Google Analytics account under “Real Time” – “Events” an event with the category and the label you gave. You just need to click on the category link and it will show you an Action and Label.

Check google real time

Well done! You have just created your first Tag!

What Happens When You Publish A Tag?

Before publishing a tag you always need to create a version. What does this mean?

Tag manager considers all the tags together as a complete group.

So each time you need to publish a new Tag you are not publishing just the tag but the entire collection.

In that way if you create a specific compilation and you need to change it completely in future, you could first redesign your Tags and then create a new version of them. Test it and once you are sure of their behavior, then you can publish them.

If you want to come back to previous versions you can do it at any time.

Google Tag Manager In More Depth

When we use the Tag Manager we are not writing any code inside our website apart from the first tracking code.

Google Tag Manager is thought to allow people with a non-technical understanding to track their events without the need to involve the IT every time they want to change their tracking strategy.

And I think they are very close to this goal.

Google Tag Manager, as you have just seen, also grabs information from our website like what link and page are active, which form we are tracking and more.

In order to collect all this information it needs a way to grab them from the website and store them somewhere.

For this purpose we have Variables like {{Link URL}} or {{Page URL}} as I mentioned earlier.

The kind of events we can collect are more than just the ones we find under the “Variable” menu though, because we can setup our own variable if needed and input more information.

Where Does This Information Come From?

All the website actions are passed from our website to GTM thanks to a place where all this information is temporarily present.

This place stands in the middle between the GTM and the Website to grab the “events” coming from the pages and pass it to the Tag manager.

This thing in the middle is called “Data Layer”.

The data layer basically takes the information from the page and passes it through a “GTM event” to the GTM Trigger and Tags.

Too Complicated?

Let’s try again.

We have the website and the Tag Manager, and there is a place in the middle that is invisible to us, we don’t care about it but we know that it is useful to send the information to GTM.

Better?

Why do you need to know this?

Because the data layer also passes events to the Tag Manager, but they are different from the Google Analytics Events and if you want to dig more into the GTM in future articles, this is fundamental to know.

The GTM Events are useful to tell GTM that some action has been performed in the website.

The Analytics Events are useful for GTM to convey to Analytics that an event in the website has been fired.

If you are wondering why you shouldn’t pass the event directly to Google Analytics the answer is simply, in this way you don’t need to code, remember?

That’s it for now! It’s time to play with your new Google Tag Manager account and try to change some Triggers and Tags.

In future articles I will show you how you can track more amazing things, including how to track a webform in a professional way. Including step by step the submission, when the user hit the thank you and confirmation page and more.

I hope you have enjoyed this article and that it has helped you to delve a little in the Goals and Tag manager world.

Don’t forget to subscribe to get my next post on Tag Manager straight to your inbox!

Get in touch with me!
Claim your Ultimatum
  1. Laura March 17, 2015 at 6:00 pm

    Hi,

    I’m used to the old interface of GTM so now, with the new interface, I don’t know how to create a virtual pageview. Before, I would create a new Universal Analytics tag and in the basic configuration I would set a variable: vpv as the virtual pageview path, but now this “basic configuration” is gone in the new interface. Do you know how I can create a virtual pageview in the new interface? Thanks!

  2. Andrea April 9, 2015 at 2:16 am

    Hi Laura, I am planning to write a new article on how to setup a virtual pageview in future. Basically you need to create a new Universal Analytics Tag, insert your tracking ID and in the track type select “Page View”. Then you will need to create the rule to fire that tag and you are ready to go.

    You can find more information here: https://developers.google.com/analytics/devguides/collection/upgrade/reference/gtm

  3. Nicolas July 16, 2015 at 11:29 am

    We just started with GTM v2 and this was really helpfull to understand a little better. Its really challeging but we are getting there. Thanks so much!

    Nicolas from Australia 🙂