Back to blog

Piwik PRO 101 – URL Tagging Best Practices

Product best practices

Written by

Published May 5, 2015 · Updated May 23, 2024

Piwik PRO 101 - URL Tagging Best Practices

So, you’ve started running some paid or organic marketing activities to drive more traffic to your website, or you may have started some online partnerships. But wait a second, wouldn’t it be great to know exactly how well your campaigns are doing? And wouldn’t you like to know exactly where your visitors come from? If this is what worries you, then tagging URLs may be the answer to your needs. Piwik PRO URL tagging best practices are fairly simple to implement and can help your analytics software to assess exactly how each individual ad or marketing initiative you’ve launched is performing.

Let’s dive in and discover some of its tenets!

Optimize Piwik’s Performance Issues: A Free Guide

Learn how to boost Piwik’s reporting speed and strengthen web analytics data security:

Download FREE Guide

Piwik PRO URL tagging best practices: it all starts with campaign parameters:

When tagging links that will be tracked in Piwik PRO or another analytics platform, it is common to use the following 5 parameters:

This parameter should include the name of the marketing campaign that the links relate to or is a part of. Generally speaking, its name should be descriptive and easy to understand by everyone who views the report. For instance, Facebook_April_2015 tells you immediately that you’re looking at a campaign related to social media activities. This parameter is obligatory for URL tagging in Piwik PRO.

This is usually the name of the site sending you traffic, for example: Facebook, Piwik_org, Techcrunch, El Mundo etc. If the traffic comes from a source besides a website, you should use the most descriptive name for this particular traffic source. For example, other popular traffic sources may be: Newsletter, Google, Bing, Yahoo, Newsletter_2, etc. This parameter is optional for URL tagging in Piwik PRO.

This parameter describes the medium used to send traffic to your website. For example, for the traffic source “Facebook”, we can use the following mediums: cpc, banner, sponsored_post, sidebar_ad. For the traffic source “Google”, we can use the medium: cpc, organic. This parameter is optional for URL tagging in Piwik PRO.

This optional parameter describes the name of the keyword used to drive traffic to your website and is only used for the PPC campaigns. It is often used alongside the tag pk_source=google and pk_medium=cpc for the Google AdWords campaigns. For this tag, you will use the keyword that triggered the ad to be displayed and resulted in a click through to your website. For example: pk_source=Google&pk_medium=cpc&pk_keyword=web_analytics

This parameter is used to differentiate the medium for the particular campaign. It may be useful, for instance, if within one campaign we are using several different banner ads or if we are sending two kinds of emails: an HTML one and a plain text one. For instance, pk_content may take the following values banner_nr1, banner_nr2, html_copy, text_copy etc.

This is one of the least used parametres. Its goal is to differentiate campaigns by ID number. If we are running simultaneously several campaigns and if they are very similar in many ways, we can differentiate them using pk_cid.

URL tagging parametersAt this point it is necessary to mention that by default Piwik PRO recognizes two pk parameters. Do not worry if you need more! You can install Piwik PRO Advanced CampaignReporting Plugin, which allows you to track up to 5 extra campaign parameters. You’ll be able to view more data from the new parameters, which will provide you with more information about the effectiveness of your campaigns. Plus it’s free!


Piwik PRO URL tagging best practices: the nitty gritty

Below are described some the most important points for consideration when tagging links.

  • Aim to tag every URL you can control that comes to your site. Each time you ask people to click a link, you should be setting up PK tagging. This includes all your email links (your email service provider likely has a way to automatically tag your URLs), ad links, press articles, blog posts, etc.

  • Use a tool called LINK BUILDER to create the URL. PK-tagged URLs can be pretty long and difficult to type in correctly. It is much easier to use Link Builder rather than copy, paste and adjust everything manually. Piwik PRO link builder is available here. This ensures you add all sensible parameters to the URL, and gives you a ready-to-go URL. To manage social links, tools like Hootsuite include the option to add custom URL parameters to all of your links.
    Piwik PRO URL Builder Tool
    Piwik PRO URL Builder Tool
  • Make sure to keep an eye on case sensitivity when typing in the parameter values. Some say this is the worst part of PK tagging. It is important to remember that the tag “pk_source=adwords” will be identified as a different tag than, for instance, “pk_source=Adwords”. Our tip is to type everything lower-case and stop worrying about it;)

  • Only use the campaign variables you really need. There are different pk parameters, but you generally need to use only pk_source, pk_medium, and pk_campaign. Avoid squeezing in too many items in your URL.


Piwik PRO URL tagging best practices: some of the no-no’s:

Once you start tagging and discover its benefits, it may be difficult to stop. However, you should not tag all your links, and in some cases, it’s better to leave them tag-free:

  • Internal Links – You should never use PK and UTM parameters for internal links on your website. Let’s imagine you publish a new post on your company’s blog, then share it on Twitter and Facebook, and then if one of our followers clicks on the link and arrives at your blog. When they are done reading, they will use one of the links and go to your home page. If this link uses “pk_source=blog” you will lose the precious piece of information telling you that user came from Twitter of Facebook. Your report will only say that the visitor came from the blog, and not from social media.

  • Organic / unpaid Search – Piwik PRO and other analytics tools let you know if a visitor comes to your website from organic search. It could tell you which keywords were used to find your website (even though Google itself does not send the keyword anymore). Yet, PK parameters override this information, so it is better if you don’t tag your SEO campaigns.

  • Natural Referrers – As your brand awareness increases, there will be more and more blogs and websites writing about your company. If this is the case, then well done! You’re doing great job. However, your referers might link to your website as a part of a blog post. It is fine if the links they use to direct visitors to your site don’t have PK or UTM tracking, as the Referrer information is actually quite useful and contains the URL of the page that brought you the traffic. Such visits will be part of the referral medium. It is a measurement of the overall awareness of our website.

Optimize Piwik’s Performance Issues: A Free Guide

Learn how to boost Piwik’s reporting speed and strengthen web analytics data security:

Download FREE Guide

To wrap up, using a good system of URL tags can give you valuable insights into your campaigns’ performance and can help you check where your traffic comes from, allowing you to segment your visitors (you may want to read our blog post on the benefits of segmentation). In a nutshell, try using URL tagging and you will never look back! And once you learn about the possibilities that come with Piwik PRO Tag Manager and how easy is it to implement tags, well, you’ll be speechless.


Ewa Bałazińska

See more posts by this author

Core – a new plan for Piwik PRO Analytics Suite

Privacy-compliant analytics, built-in consent management and EU hosting. For free.

Sign up for free

Upcoming live webinar

June 27, 2024

Real-time dashboards in Piwik PRO: A hands-on use case

This summer, we’re introducing new real-time dashboards in Piwik PRO Analytics Suite, empowering our clients to make informed decisions in time-sensitive projects. Would you like to learn how to use them in your daily work? Join our webinar to see how our partner agency, Netlife, used real-time insights to streamline the registration process for a major national event, ensuring a smooth user experience and preventing system breakdowns. Stay for a Q&A session where our experts will address all your questions.

Sign up for this webinar