How to build campaign tracking URLs
As Campaign Tracking URLs are created by appending parameters to the end of a URL, it is technically possible to create tracking links manually by typing them out. However, the easiest way to create campaign tracking URLs is with one of the official URL builders. You can use the Matomo URL Builder on the Matomo website.Or, if you are logged into your analytics, there is a Campaign URL Builder tool built directly into Matomo. The process for using the built-in tool can be found below.
How to generate campaign tracking URLs with the Matomo Campaign URL Builder
- Log in to your Matomo instance and click on the Acquisition section.
- Click on Campaign URL Builder sub-menu item.
- Copy the URL from your website that you would like to create a tracked link for.
- Paste the copied link into the Page URL (Required) field.
- Add any required and desired campaign values in the remaining fields. In the grey box alongside each field, there is a description of what it should include, along with examples.
- Click the big green Generate URL button at the bottom of the page.
- Copy the generated URL from the grey box below and use it wherever you are running your campaign, for example, in an email or a third-party marketplace.
Important Note: You have to actually use the tracked URL in your campaigns for it to be useful. Generating the link alone does nothing as campaign links are only useful when people actively click on them. Therefore you need to embed the tracked URL within your digital marketing campaigns.
Select appropriate campaign values
While you can type almost anything as values for each of the campaign tracking elements, you will want to plan ahead to ensure they are useful. In general, you want to make sure that you use descriptive human-readable values so you will be able to easily identify them when reviewing your analytics.
There are a few considerations which may not be immediately apparent.
-
Campaign values are stored in lowercase – For consistency, don’t use capital letters when creating your campaign tracking values.
-
Special characters may not work – If you want to use special characters such as a forward slash in your value, you will need to encode it for use within a URL. As an example, to include a forward slash in your campaign values, it would need to be typed as %2F within your URL. Click here for a URL encoding tool.
-
Don’t use spaces – This is also related to URL encoding. The space character will often break links. Many people choose to use underscores or dashes to represent spaces instead. Although, you can also encode spaces for URL usage by typing %20. For example, if you were creating a tracked link for a “brand awareness” campaign, you might use:
- brand%20awareness – Displayed as brand awareness in your analytics
- brand_awareness – Displayed as brand_awareness in your analytics
- brand-awareness – Displayed as brand-awareness in your analytics
Whatever method you choose, it is important to be consistent, otherwise, you will find your traffic split between multiple variations of the same campaign, which can make accurate reporting harder.
- Campaign tracking values are visible – One final consideration is that all of the campaign values are visible to the end-user. This may seem obvious, but it also means that people may notice the values when visiting your website. Make sure you choose values that you are happy for the public to see and avoid including any personal data or personally identifiable information (PII) within your URLs.
You may not want to use the following URL, for example:
https://example.com/?mtm_campaign=secret_list&utm_source=private_supplier&utm_content=john_smith
How Matomo manages MTM and UTM parameters in one URL
-
When constructing URLs that contain both MTM and UTM parameters for the same property (e.g.,
mtm_campaign=invest_webinar&utm_campaign=invest_tips
), the MTM parameter takes priority. In this example, the campaign value will beinvest_webinar
. -
When constructing URLs that contain both MTM and UTM parameters for different properties (e.g.,
mtm_campaign=invest_webinar&utm_source=newsletter
), the values for each parameter are used. -
If you use multiple parameters for the same property (e.g.,
mtm_campaign=invest_webinar&mtm_campaign=banking_guide
), the value is taken from the parameter listed first. In this example, the campaign value will beinvest_webinar
.