Analytics Campaign Tracking
Campaign tracking in Matomo Analytics (formerly Piwik Analytics) lets you track how efficient various marketing campaigns are in bringing visitors to your website (visits, page views, etc.), how well these visitors convert and how much revenue they generate.
Campaigns can track various ways of acquiring traffic, such as:
- Yahoo! Search Marketing, Google AdWords, Microsoft adCenter: Paid search marketing campaign, Cost Per Click (CPC)
- Display Ads, Banners
- Links in Newsletters, Emailing
- Affiliates links (sometimes called Subids tracking)
- Facebook Ads
Maybe you are already spending money bringing visitors via Adwords, Yahoo, Facebook, etc. to your website. Tracking Campaigns will let you know how successful these campaigns are in bringing new visitors (how many visits? pages? downloads?) and whether they are converting to your Goals.
- What is the conversion rate for visitors coming from Adwords VS Yahoo! search?
- How much revenue was generated from visits via your monthly newsletter?
- If you buy display adverts on Facebook, how much revenue on your Ecommerce website was generated by each advert? Which Facebook advert performed the best?
Tracking Campaigns using URL Parameters
Campaign tracking in Matomo (Piwik) is simple: add one (or two) parameter(s) to your website URL. For example, instead of putting a link to your website such as
http://example.org/landing.html in your email newsletter or adword destination URL, you would instead put a link to
All visitors who open the email and click on the link will arrive on your website. Matomo (Piwik) will track the visit, and detect the parameter
pk_campaign in the URL of the first page view, and the visit will be credited to the Referrer > Campaign: “Email-Nov2011”.
Screenshot of the Analytics Campaign reports showing various marketing campaigns: Adwords, Facebook, Newsletter, Display ads
Matomo (Piwik) lets you define up to two parameters in your page URLs. This allows for more advanced tracking. For example, if your Email newsletter contains various calls to action: “Learn more” and “Order now”, you could tag the links as follows:
1) <a href="http://example.org/landing.html?pk_campaign=Email-Nov2011&pk_kwd=LearnMore">Learn more</a> 2) <a href="http://example.org/landing.html?pk_campaign=Email-Nov2011&pk_kwd=OrderNow">Order now</a>
Matomo (Piwik) also supports detecting the campaign parameters in the hash tag. The advantage of using the hash tag is that your campaign tracking URLs will not be considered “duplicate URLs” by search engines. The following URLs will work:
1) <a href="http://example.org/landing.html#pk_campaign=Email-Nov2011">Click here for more info</a>0 2) <a href="http://example.org/landing.html?q=test#pk_campaign=Email-Nov2011&pk_kwd=OrderNow">Order now</a>
In the report Referrers > Campaigns, you would then be able to click on the row “Email-Nov2011” and see how the two links performed:
On a click on a Campaig name (value of
pk_campaign) are displayed the specific links clicked in the newsletter (if you tracked it via in
Did you know? By default, Matomo (Piwik) attributes all conversions to the last seen referrer. As users typically visit your website several times, using different campaigns and referrers, you can find out the true success of your campaigns by applying attribution models using the Multi Channel Conversion Attribution premium feature.
Tracking campaigns is easy: you don’t need to edit your Matomo (Piwik) Tracking code, only the URLs pointing to your website. You can track an unlimited number of campaigns (and keywords). You do not need to configure campaign names in advance. Just use them in the links to your website and visitors following those links will be tracked as campaign referrers.
Campaign URL Generator
It can be a bit tricky to manually generate URLs for use in Adwords, Yahoo! search marketing, in your Affiliate URLs or in your Email newsletter. To make sure your URLs are correct, you can use the following tool which will create the URL, that you can then copy and paste wherever you are linking your website.
We highly recommend that you bookmark the link to the URL Builder: https://matomo.org/docs/tracking-campaigns/url-builder/ and use it as often as possible to tag all your links, which is the first step to getting better insights into your campaigns’ performance in Matomo (Piwik).
Goals & Ecommerce Campaign Attribution
A same visitor will sometimes visit your website multiple times (hopefully, often!), perhaps using a few different referrers.
For example, a visitor can find your website by clicking on a Display Ad, then two days later come back by typing a keyword in Bing. If the visitor then buys a product on your site, should the “revenue” from this purchase be attributed to the Display Ad, or to the keyword typed in Bing?
Piwik, by default, will attribute the conversion to the last referrer used to access the site (Bing in this example). If you wish to change this behavior to credit the first Referrer used (Display Ad in this example), please check out the FAQ: How to change attribution so that Matomo (Piwik) credits the first referrer used.
Attribution data is saved in a first party cookie
FAQ: Tracking campaigns
- My URLs are tagged properly, but no Campaign is showing in Matomo (Piwik) Campaigns reports?
- Does Matomo (Piwik) support Google Analytics campaign parameters (
- What is the advantage of tracking campaigns vs leaving the URL as is?
When a visitor clicks in an email newsletter, or in a paid search ad, it will show as a “Direct Entry” in Matomo (Piwik). Looking at your analytics reports, you will not be able to tell if the email newsletter or paid search ad (or Display ad, etc.) have made a positive impact on your website. Tracking campaigns in Matomo ensures that you will be able to tell exactly how many visits were generated with each campaign, how many pages the visitors looked at, the bounce rate, and also the conversion rate to your Goals, and the revenue generated by these visits. Tracking campaigns is a very important part of understanding your websites’ performance.
- How do I use the Campaign tracking report to increase my website revenue or visitor engagement?
The Campaign report will tell you how well your campaigns are performing. We highly recommend that you set up Goals in Matomo (Piwik) for each website tracked, so you can use the metrics “Conversion rate” or “Revenue”. You will then be able to look at each individual Campaign performance (and even Keyword performance), and see what campaigns are generating more value (in particular, which campaigns are generating more than they cost you to advertise!).
Tracking more than two campaign dimensions
By default Matomo (Piwik) is able to track two dimensions: the campaign name and the campaign keyword. The MarketingCampaignsReporting plugin lets you track up to 5 dimensions for campaigns: campaign name, campaign source, campaign medium, campaign keyword, campaign content.
Tracking Paid Search Ads
If you are buying specific keywords on Search Engines (SEM), you can use a macro so that when visitors click on your paid adverts in the search results, the click URL to your site will contain the actual keyword you bid on. This is very useful, since you don’t have to manually change all the destination URLs for the same advert. For example, imagine you are running a campaign to advertise the best summer deals, you would use the following URLs:
- Adwords: the URL would look like:
Yahoo! Search Marketing:
Microsoft Ad Center (Bing Search):
(more information about Microsoft advertising tagging)
- Yandex.Direct and Yandex Advertising Network:
(more information about Yandex.Direct advertising tagging)
- Yandex.Direct and Yandex Advertising Network:
It is highly recommend that you tag all your paid search marketing adverts carefully, to ensure that your analytics campaign reports show how the marketing money you spent is contributing to your website’s success.