Improve your website performance with Google Analytics goals
Table of Contents
- Why have goals?
- Creating goals
- Destination goals
- Event goals
- What next?
Why have goals?
Goals allow you to easily check that your website is achieving the results that you want it to. Defining goals is an important part of a successful website plan and they should match up to the website objectives that you set during planning.
A common use for goals is tracking enquiry form submissions, they can also be used to track other different types of behaviour such as document downloads or how many people spend a certain amount of time on a given page.
Assuming you already have Google Analytics in place, you need to go to the Goals tab under Admin.
This will show you any existing goals and give you the option to create new ones. Click on red New Goal button to get started on creating your goal. If you don’t have a New Goal button, check with whoever created the Analytics account that you have permission to make changes.
The Goal Setup screen gives you the option of using a Template or defining a Custom goal. We recommend using Custom as if you understand these, you will have a lot more flexibility when creating goals.
Goal Description lets you give the goal a name, this will be used when viewing goal data in reports, so make it something easy to understand.
You are allowed a limited number of goals, these each have a Goal Slot ID. Goal Slots are also grouped into Goal Sets, when viewing data you can view goals as sets, so if you had multiple enquiry forms you may want to create a goal for each and include them all in the same set. However, for day to day goal creation, you can just ignore this and use the default Goal Slot ID.
Lastly, the Goal Type enables different types of tracking:
- Destination – based on the user reaching a specific web address
- Duration – tracks users who spend a certain amount of time on your website
- Pages/Screens per session – monitors users who visit more than a defined number of pages
- Event – events are created by custom code in your website to track anything that can’t be tracked using the above, as such they are very flexible and powerful
Destination and Event are the most common goals that you will want to use, here’s how they work:
The only required information to create a Destination Goal is the destination itself. This will usually be the web address of the page you want people to reach, minus your domain name.
For example, we will assume that users are completing a form on our contact page https://www.bigfork.co.uk/get-in-touch/ and are then redirected to a confirmation page at https://www.bigfork.co.uk/get-in-touch/thankyou.
So to create a goal based on people reaching the confirmation page, we would say the Destination is Equals to and the web page is /get-in-touch/thankyou.
What if we had multiple confirmation pages depending on how people completed our enquiry form? If this is the case then we can use a different option in place of Equals to.
For example, we might have these confirmation pages:
In this case, we don’t want to create three goals for the same form (though we could and there’s no reason why not), so we change Equals to for Begins with and set the web page to /get-in-touch/thank because all of the confirmation pages begin with this.
When doing Begins with, be sure to make the web page specific enough that it won’t track other pages by accident. For example, if we just set the goal to Begins with /get-in-touch/ it would track the contact page as well as the confirmation page.
The third option after Equals to and Begins with is Regular Expression. This gives you more flexibility but is also more complicated to set up. Let's say we had a fourth confirmation page:
We can no longer track this with the same Begins with settings as it doesn’t begin with /get-in-touch/thank. We can track this with a regular expression though:
Our setup now says we want to match a Regular expression based on
^/get-in-touch/.*thank.* - this tells the goal to match anything that begins with /get-in-touch/ followed by anything that includes thank.
As you can see, regular expressions are a bit more complicated, so if you don’t understand them then it’s best to stick with destination goals that use Equals to and Begins with.
This optional setting allows you to set a monetary value for a goal. Sometimes a goal is easily quantifiable, e.g. a £10 purchase will most likely be worth £10, so has a value of 10.
For something like an enquiry form, a value may not make sense, though you could enter a value that represents the average order value for a successful website enquiry conversion.
Adding a goal funnel to a destination goal means you can specify a series of pages the user should visit before reaching the final destination. In our enquiry form example, we can use it to make sure we only record a goal completion if someone reached the confirmation page via the contact page.
To add a funnel, toggle the Funnel switch to On and you can then enter the steps that a user should take. These are optional steps unless you toggle the Required? switch to make a step mandatory. For our contact form we want the step to be mandatory to ensure we only track people who have reached our confirmation page via the contact page.
When specifying a funnel, the goal will count as long as the steps are all performed in order. Other pages can be visited in between, as long as at some point all the funnel pages are visited in order before reaching the destination page.
An example of when you might have a funnel with non-mandatory steps is when you want to monitor how far people go in a checkout process. Even if they don’t reach the goal, you can still use the data to see how far people go through the funnel.
Once you have set up your destination goal, you can click Save to start it running. If you have existing website data, there is also the option to Verify the goal which will tell you the conversion rate (how many times the goal was completed versus how many visitors you had) the goal would’ve achieved in the last 7 days.
Testing the goal
Once you have created your goal, a good way to check that it’s working is to use Google Analytics’ Real-Time tracking. You can find this under the Reporting tab at the top, then Real-Time on the left. Click Conversions to view goals and you will see all your goals listed.
If you open a new browser window or tab and then perform the steps required to complete your goal, you should see bars appear under Goal Hits and also the counter in the Goal table increase.
Should this not happen, there are three things to check:
- Your analytics account is set up properly and receiving data
- You are not excluding your IP address from reports *
- Your goal is configured correctly
* It is good practise to exclude your own IP address, so if this is the case then a good way to test your goal is to disable Wi-Fi on your phone and access your website using 3G/4G as this will have a different IP address.
Event goals differ to destination goals in that they are not tied to a specific web address. They could instead be an email link or a PDF download. To capture event goals, you will need event tracking code in your website.
Creating analytics events
Events are a bit more complex in that they require additional setup, the payoff is that they allow a lot of flexibility and customisation. For example, a PDF download link with event tracking code might look like this:
<a href="myfile.pdf" onclick="ga('send', 'event', 'File', 'Download', 'myfile.pdf', 1)"> Download My File </a>
In this example, the bit after onclick is the code that tells Google Analytics to record an event. If you’re unsure about what all these means, your web designer should be able to help. These options are always the same for tracking events:
- send tells Google Analytics we want to tell it something
- event informs it that we are telling it about an event we want to track
These options are customisable to suit your requirements:
- File is the event category, your events will be grouped by these when viewing reports
- Download is the event action describes what type of event we are actually tracking
- myfile.pdf is the event label that differentiates this event from others with the same category and action
- 1 is the event value, in this example it has no real meaning but is required for creating our event goal
If we had a second file called my-other-file.pdf, our tracking code could look the same apart from the event label which we would change from myfile.pdf to my-other-file.pdf.
Once created, analytics events can be viewed in the Reporting tab under Behaviour > Events. However, we want to track our events as conversions so will create a goal for PDF downloads.
Setting up an event goal
Assuming we have our event tracking code in place, we can now create our PDF download event goal.
When creating an event goal, Google Analytics requires four bits of information:
These directly correspond to the data we sent to Google Analytics when we track an event, so all we have to do is match the data we send to the information required.
So if we compare this to our event goal:
<a href="myfile.pdf" onclick="ga('send', 'event', 'File', 'Download', 'myfile.pdf', 1)"> Download My File </a>
We can see that our event Category is Equals to
File, Action is Equals to
Download and Value is Equals to
The reason that Value is Equals to
1 is that a value is required to track the event as a goal, because there is no actual value – monetary or otherwise – attached to a file download, we just set it to 1.
You’ll notice that Label is set up differently. We could have set this to Equals to
myfile.pdf and this would have created a goal for whenever
myfile.pdf was downloaded. However we want to track all PDF downloads, so instead have used a regular expression of
This tells the event goal to track any label that ends with
file2.pdf as long as their event category, action and label all match up.
If you’re not comfortable with regular expressions then you could just as easily create an event for each file separately using the Equals to method, just be aware that if you have a lot of files there is a limit on the number of goals you can create (currently 20).
Another example of a tracking event we often use is for monitoring email links, the event goal is set up like this:
When tracking email links, we use the event action to track which email link was clicked (e.g. header, content, footer) and the event label to tell us which page the user was on when they clicked the email link.
We can find the exact details of these under Reporting but when we set up an event goal for tracking emails, we only know that the event category will be
Email Link, so we set that to be an Equals to field, the action and label use regular expression
.* which means they can be anything. An email link doesn’t usually have a tangible value so we just set it to 1 as per the PDF download example.
Once you have created your event goal you can verify and test it in the same way as destination goals.
Once you have created goals for your website, you will see an overview of them on the main goals page.
From here you can enable or disable goal tracking by toggling the corresponding Recording switch, as well as seeing the past 7 day conversions which is a good way of quickly seeing if a goal appears to be working.
To get real value from goals, you can begin to make use of the data they provide in Google Analytics reports.
Our forthcoming article "Measuring Google Analytics Goals" will cover more details including:
- Viewing goal data
- Adding goals to dashboard
- Funnel visualisation
- Comparing goals against other metrics
- Custom reporting using goal conversions