Creating a Goal
To set up a goal, visit the Goals section in Matomo and then click over to Manage Goals. This page will show any existing goals you have along with a large green button to Add A New Goal. Clicking this button will bring up the Update Goal view where you can add all of the required details. If you can’t access this, you need to make sure that you have Write permissions.
You should select a descriptive goal name that is easy to reference, for example New Job Application. It may also be useful to set up a specific naming convention if you will have many similar goals. For example, you might use a pattern such as, Click – Affiliate Link and Click – Partner Site, so you can easily find and reference similar goals. In the example above, you can tell at a glance that both Goals relate to link clicks on your site, as well as further detail on exactly what was clicked. You can also add a short description below the name field to help remember the more specific details or context of the goal.
Goal Triggers
There are many actions that can trigger a Goal, however all triggers are set up in one of two ways. The first is by using automatic built-in triggers which you can select while the default when visitors option is active. Alternatively, you can set goals to trigger manually. This requires you to add custom javascript, which is fired on your website when certain Goal conditions are met.
How to Trigger Goals Automatically “When Visitors” Do Something (Recommended)
Automatic triggers are the simplest method for setting up Goals. There are several of these methods you can use without having to add any additional code to your website. You simply select from the automatic triggers shown on screen:
- Visit a given URL (page or group of pages)
- Visit a given Page Title
- Send an event
- Download a file
- Click on a Link to an external website
- Stay for a certain amount of time
Each of the above methods will require you to define specific action that is required to fire the trigger for your goal. When using Visit a given URL (page or group of pages) as an example, you can select from the following options via the dropdown menu, then define your specific filters in the text box that follows:
- Contains – This method triggers the goal when a visitor visits a page where the URL contains what you type in the text box. This option is especially useful when you want to match a range of options with a similar theme, such as all contact pages on your website. For example, typing contact in the text box would make the Goal fire if a user visited either of the following pages on your site:
https://example.com/contact.html
https://example.com/support/contact/ - Is Exactly – This method allows you to get really specific so the goal only fires on the exact URL that you enter, for example https://example.com/contact/submitted/ which might be a page shown once somebody has sent a message through a contact form.
- Matches The Expression – Matching by expression is the most complex method. However, it also allows for the most advanced targeting options. It utilises something called regular expressions, or regEx for short, which can be difficult to understand when you first encounter it. If you are unfamiliar with regular expressions, we highly recommend you learn about regex before using it, and test your RegEx patterns extensively. The patterns you create would look a little something like this (.)\/contact\/(.) which in this instance would match any page containing /contact/ in the URL, such as https://example.com/contact/
All matching types based on the text patterns described above are followed by a checkbox so you can decide if you would like your trigger to be case sensitive. With case sensitivity turned on, a trigger set to check when users Visit a given Page Title which exactly matches the trigger, Contact Us, would not match a page title of CONTACT US due to the use of all uppercase letters.
How to Manually Trigger Goals in Matomo with JavaScript
Generally, you would only use manual triggering for a goal if it is not possible through one of the standard options. To manually configure your goals, you need to update your website or app so it calls some custom JavaScript. The most basic implementation looks a little something like this:
// Log a Conversion for Goal 1
window._paq = window._paq || [];
window._paq.push(['trackGoal', 1]);
The code above works by telling Matomo you want to push data into the platform _paq.push([ ]);
and then trackGoal
defines the type of data being sent. From there, Matomo recognises the unique Goal ID set in the second numeric variable and records the relevant conversion statistics. You can find your Goal IDs for manual configuration in the first column of the table shown on the Manage Goals section, after you have finished configuring your goals within the Matomo dashboard.
Manual triggering of goal conversions for Matomo is covered in more depth – including how to link a dynamic revenue amount – within the developer documentation.
Allow Multiple Goal Conversions (or Not)
The next step of the Goal configuration flow allows you to set whether you Allow multiple conversions per visit or not. By default, each Goal can only be counted once per visit. This is useful for things like newsletter subscription confirmation pages where the user can only register for your newsletter once, but they may load the confirmation page multiple times.
The reverse scenario of counting a specific conversion multiple times is useful for actions where you care about cumulative results. For example, if users can leave multiple product reviews or apply for multiple jobs, and you want to track each time this happens, then you would update this setting to Allow Goal to be converted more than once per visit.
Tracking Goal Revenue (optional)
Not every goal will lead to revenue, but many will, whether directly or indirectly. The next field in the standard Goal creation flow is to set an optional Goal Revenue figure. This doesn’t have to be an exact value, or even require that the goal be attached to a sale, but it can help you evaluate the return on your marketing efforts.
For example, if you know that on average you sell one $1,000 service for every one hundred leads, then averaged out, each lead is equal to about $10. Therefore, you could set the Goal Revenue to $10 as the logic follows that by the time you’ve reached your hundredth lead you will likely have made at least one $1,000 sale.
Premium Features for Matomo Goals
Funnel Settings
If you have access to the premium Funnels feature, either through a Matomo Cloud Subscription, or the plugins Marketplace, you will be able to configure funnel tracking next. This is useful for tracking users’ conversion paths before completing a goal. Importantly it also helps you understand where users, that don’t convert the goal, are getting stuck, so you can improve that step to improve your goal conversions.
An example of this can be found on the Matomo Demo site where Job Applications are tracked:
- Job board – This is the beginning of the funnel where somebody views all available jobs.
- Job view – The next step of the funnel is viewing any specific jobs of interest.
- New Job Application – The final Goal of this funnel is reaching the job application form.
While your Goal metrics track how many people have applied for a job in total, you may also want to know what percentage of people reached each stage of your conversion funnel. Using the example above, you may see you are getting lots of visitors to the Job board and Job view stage, but for some reason they don’t click through to the application page. This would indicate there is potentially an issue with the job details or the final conversion step. For more information on this feature check out the Matomo Funnels user guide.
Multi Channel Conversion Attribution
If you have the Multi Channel Conversion Attribution plugin or a Matomo Cloud Subscription you will also see a simple checkbox option on the Goal update page. This premium feature collects more data on all of the contributing lead sources that have led to the completion of your Goal Funnel. It can keep track of users even if they leave your site and come back through another channel. For more information on the data that is collected by this feature, check out the full guide on Multi Channel Conversion Attribution.