Campaign Tracking is a feature which enables you to log marketing campaign details when linking to your website online. This can help you track the exact impact of your marketing campaigns. It reveals things like, how much traffic they are bringing in, how engaged those visitors are, and whether the campaign is resulting in sales or not.

The Value of Campaign Tracking

If you are new to analytics, you might wonder why you need campaign tracking links at all. After all, Matomo already tracks the websites and search engines that refer traffic to your site. However, this standard type of referral tracking doesn’t work for all traffic types. Emails are one common example where it is not possible to automatically tell where a visitor has come from and the visit will show as a “Direct entry”. In cases like this, setting up email campaign tracking URLs ensures you know how visitors reach your site when it matters.

One other benefit of campaign tracking URLs is you can configure them to tell you exactly which email, button or link a user came from. You can set different campaign names for each email and each link to tell them apart.

Of course, email marketing is only one situation where you can use campaign tracking. Campaign tracking URLs are commonly used to get enhanced tracking data from the following sources:

  • Pay-Per-Click (PPC) Adverts – Which campaigns and keywords are driving revenue?
  • Display and Banner Adverts – Which platforms and specific banners are driving traffic?
  • Third-Party Marketplaces – Which external listings refer people back to your website?
  • Social Networks – Which social media posts are getting the most traction?
  • Email Newsletters – Which newsletter campaigns are driving traffic and sales?
  • Guest Blog Posts – Which external content attracts the most website visitors?
  • And many more!

With campaign tracking, each traffic source or different link on the same page can have its own unique tracking values. The more specific you are with your use of campaign tracking links, the better quality data you will receive. When reviewing your campaign reports in Matomo, you can compare the statistics from each campaign and focus your marketing efforts on the campaigns that are working well.

The Anatomy of a Matomo Campaign Tracking URL

As previously mentioned, campaign data is tracked through the use of URL parameters. In the example below, you can see a standard URL and a campaign tracking URL with a campaign tracking parameter attached:

  • Standard URL:

  • Campaign Tracked URL:

The bold part at the end of the second URL is an example of the mtm_campaign campaign tracking parameter in use. Both of the links above go to the same web page; however, the second link tells the website which campaign it came from. In this case, the value is set to the newsletter_cyber_monday campaign.

Although there is only one campaign parameter in the example above, it is worth noting that there are two parameters available within Matomo by default and a total of eight parameters for even more detail if you are using Matomo Cloud or the Marketing Campaigns Reporting plugin.

The full set of eight campaign tracking parameters allow you to add even more context to your links and are recommended. Below you will find a list of the complete set of campaign tracking parameters, along with a short description of the values you would attach for each.

Default Campaign Tracking Values

  • Campaign (Required): mtm_campaign
    A descriptive name for the campaign, e.g. a blog post title or email campaign name.

  • Keyword (Recommended): mtm_keyword
    The specific keyword that someone searched for, or category of interest.

Additional Campaign Tracking Values

(Available with Matomo Cloud or Marketing Campaigns Reporting Plugin)

  • Source (Recommended): mtm_source
    The actual source of the traffic, e.g. newsletter, twitter, ebay, etc.

  • Medium (Recommended): mtm_medium
    The type of marketing channel, e.g. email, social, paid, etc.

  • Content (Optional): mtm_content
    This is a specific link or content that somebody clicked. e.g. banner, big-green-button

  • ID (Optional): mtm_cid
    A unique identifier for your specific ad. This parameter is often used with the numeric IDs automatically generated by advertising platforms.

  • Group (Requires Matomo 4 or above): mtm_group
    The audience your campaign is targeting e.g. customers, retargeting, etc
    Note: Requires Matomo 4 or above.

  • Placement (Requires Matomo 4 or above): mtm_placement
    The placement on an advertising network e.g. newsfeed, sidebar, home-banner, etc.
    Note: Requires Matomo 4 or above.

Hopefully this has given you a general idea of what is possible. You will find some examples of each of these campaign elements in the guide next up.

Another Option is a Tracking Pixel

By the way, if all you want to do is detect when a recipient opens your HTML-formatted newsletter, you don’t need to make a campaign link URL. Instead you can place a non-visible image in the newsletter and track the loading event of the image. See more here for how to make a Tracking Pixel.

Exercise: Get Started With Campaign Tracking

If you have not used campaigns before, we highly recommend you start using campaigns. As an exercise, send an email newsletter and use the campaign URL builder described below to generate a campaign link for all your links. Then look at the campaign reports to measure the impact the newsletter had on the traffic to your website and your business objectives. If you don’t send email newsletters, try to include the campaign links within your support emails or in your social media shares. You can find a list of common use cases in this guide