url parameter playbook graphic

The ultimate URL parameter playbook

Contents

Marketing managers often struggle to really understand how their campaigns are performing. Complicated analytics tools and confusing data can lead to decisions based on instinct or intuition instead of concrete insights. Adding to the frustration, the constant demands of data privacy compliance make things worse, with lengthy reporting processes and technical hurdles leaving less time for analysing data and crafting effective strategies.

This playbook puts URL parameters to work, providing the key to precise campaign tracking and informed decisions. Learn how to use these simple yet effective tools with Matomo to gain crystal-clear insights, improve ROI, and stay fully compliant with data privacy regulations—all without needing to write any code.

What are URL parameters?

Parameters are short tags added to links that record where a visit came from and the context of the click. They turn a plain URL into a source of clear, comparable campaign data for analysis.

Decoding the URL: Query strings vs. URL parameters

The query string is the part of the URL after the question mark ā€œ?ā€ and before any hash fragment ā€œ#ā€ or the end of the URL. Inside that query string live the parameters, written as ā€œkey=valueā€ pairs and separated by ā€œ&ā€. 

A schematic showing the parts of a URL focusing on the structure of the URL query string and the URL parameters, values, and separators.


For example:

https://example.org/offer.html?mtm_campaign=Summer%20Sale&mtm_kwd=winter%20clothes&mtm_source=affiliate&mtm_medium=email&mtm_content=image%20link&mtm_cid=03062025-1721&mtm_group=millennials&mtm_placement=top%20banner

Here, ā€œmtm_campaignā€, ā€œmtm_sourceā€ and their values are parameters created with Matomo’s URL builder. When someone clicks this link, Matomo records the campaign name, source, medium, and more, allowing comparison of channels and creatives without manual tagging.

Need extra fields? Install the free Marketing Campaigns Reporting plugin to track up to five campaign dimensions.

A note on special characters: URL encoding 

Some characters are reserved in URLs. Encoding replaces them with a safe code so nothing breaks. Spaces will often become ā€œ%20ā€. Do not worry about the details, as browsers and tools like Matomo handle encoding automatically.

CharacterURL encoded equivalentCharacterURL encoded equivalent
Space20%/%2F
!21%:%3A
22%;%3B
#23%<%3C
$24%=%3D
%25%>%3E
&26%?%3F
ā€˜27%[%5B
(28%\%5C
)29%]%5D
@40%^%5E
`60%{%7B
*%2A\%7C
+%2B}%7D
,%2C


Different types of parameters

Not every parameter behaves the same way. Two useful lenses help plan and troubleshoot:

  1. Whether a parameter alters the page itself.
  2. The function it performs for the visitor or the analytics it provides.

Active parameters

Active campaign parameters change what a user sees on the page. They modify the content or layout so that search engines can treat the resulting URL as a distinct page. Examples:

  • ā€œsort=price_ascā€ reorders products from low to high
  • ā€œcategory=boots&colour=blackā€ filters a catalogue view
  • ā€œlang=frā€ serves the French version of a page

Passive parameters

Passive parameters do not change the page content. They carry context for analytics or routing, and the page looks the same without them. Examples:

  • ā€œmtm_source=newsletterā€ and ā€œmtm_campaign=summer_saleā€ for campaign tracking
  • ā€œutm_term=running+shoesā€ to capture the paid keyword
  • ā€œref=partner123ā€ to attribute an affiliate

Functional categories of parameters

CategoryPurpose and examples
TrackingRecords click source, campaign and creative. Examples: mtm_source, mtm_medium, mtm_campaign, mtm_content, mtm_kwd.
FilteringLimits results to a subset for faster findability. Examples: brand=nike, size=10, availability=in_stock.
SortingChanges item order to match intent. Examples: sort=price_asc, sort=rating, order=newest.
PaginationPoints to a specific page in a long list. Examples: page=3, per_page=24.
SearchingSends a query to site search.
Examples: q=strollers, search=wireless+earbuds.
Translating / localisingServes the correct language or region. Examples: lang=de, locale=en-GB.
IdentifyingReferences a product, user or resource for lookups.
Examples: product_id=12345, sku=ABC-123, user=8472.

Marketing use cases for using parameters

Parameters join the dots between clicks and outcomes across every channel. Tag once, maintain consistent naming, and then compare performance in Matomo without relying on manual spreadsheets. 

Icons representing email marketing, social media, paid advertising, and affiliate marketing, connected to a central analytics dashboard.


For quick ideas and patterns to try, here are some common campaign tracking use cases and examples.

Tracking email campaign performance

Add parameters to every newsletter link so Matomo records source, medium and campaign. For example, mtm_source=newsletter&mtm_medium=email&mtm_campaign=spring_launch. Email platform data can also be mapped to Matomo.

Using Mailchimp? Check out our guide to track Mailchimp email clicks in Matomo.

Measuring social media ROI

Social budgets spread across organic posts and paid placements. Parameters standardise the click data, providing a way to attribute visits, conversions and revenue back to each network and post type. 

Pair consistent tagging with the Multi Channel Conversion Attribution plugin to see first touch, last touch, or position-based credit. This helps you decide where to invest next and which creatives to scale.

Analysing paid advertising effectiveness

For search and social ads, apply parameters at the campaign or ad level. Capture keyword, ad group, audience or placement in ā€œmtm_contentā€ or ā€œmtm_kwdā€ to compare cost against conversions by slice. This makes A/B tests faster to read and keeps reporting stable even when platforms rename fields.

Understanding affiliate marketing performance

Give each partner a unique parameter, such as ā€œref=partner123ā€ or record the partner in ā€œmtm_sourceā€. Matomo helps create a simple affiliate system that will attribute clicks, leads and sales to the right affiliate, which supports accurate commission payments and shows which partners bring high-value customers.

Common parameter pitfalls to avoid 

Parameters are useful for measurement, yet unmanaged, they can negatively impact search performance. This can create a few issues for marketers and SEO teams.

Duplicate content

Small parameter changes can result in multiple URLs that display the same page. 

A product grid at ā€œ/shoesā€ might also load at ā€œ/shoes?sort=price_ascā€, ā€œ/shoes?size=10ā€, and ā€œ/shoes?size=10&sort=price_ascā€. 

Search engines treat these as separate pages, which weakens each’s SERP position and visibility. Ranking signals spread between them, pages compete with each other and the clean version may struggle to win. 

Illustration showing duplicate content, wasted crawl budget, and diluted link equity due to improper URL parameter handling.

The result is poor performance and fewer organic visits. Relying on parameters for filters or tracking requires a clear plan to direct search engines to the preferred version and maintain consistent internal links.

Protecting your crawl budget

Crawl budget is the time and resources a search engine sets aside to explore a site. It is not unlimited. 

Parameterised URLs multiply quickly so that bots can spend their visit on many thin variations rather than key pages. Important content gets crawled less often, updates get discovered later, and visibility can drop. Large catalogues feel this most when every sort, filter, and view mode adds new URLs. 

Keep the most valuable pages easy to reach, reduce unnecessary variants, and guide bots toward the versions that matter.

Diluted link equity

Links help search engines judge which page deserves to rank. When shares and backlinks point at parameterised URLs such as ā€œ?mtm_campaign=spring_launchā€, the authority those links pass can splinter across many addresses. A clean URL earns less credit, even though it is the page you want to rank. 

The same split happens when internal links sometimes include tracking parameters and sometimes do not. Aim to keep public and internal links pointing to the canonical URL, and ensure that any tracking tags are stripped where they are no longer needed to persist.

Best practices for parameters

When handled well, parameters give clean data without harming the search. The aim is simple: show search engines one preferred version of each page while keeping rich campaign details for reporting.

Canonicalisation

Use a canonical tag to point each set of parameterised URLs to a single, preferred address. 

In most cases, that is the clean version without tracking tags. Place a self-referencing canonical on the canonical page, then add the same target on common variants such as ā€œ?sort=price_ascā€ or ā€œ?mtm_campaign=summer_saleā€. 

Keep rules consistent across templates so lists, filters and pagination are all resolved to the correct URL. If a parameter truly creates unique content worth indexing, let that page self-canonise and treat it as a distinct destination.

Guiding search engines through internal linking

Links teach crawlers what matters. 

Keep navigation, breadcrumbs and body links pointing at the canonical URL, not at parameterised versions. 

Avoid adding tracking parameters to internal links as they overwrite attribution and multiply crawl targets. 

Standardise trailing slashes, capitalisation and parameter order so that the same page is never linked in two different ways. 

For language targets, use dedicated paths or subdomains where possible rather than ā€œ?lang= parametersā€, then connect them with hreflang.

Using robots.txt with caution

Blocking parameters via robots.txt can sometimes backfire: it prevents crawling but not indexing. It can also hide signals that help canonicalisation work.

Canonical tags consolidate ranking signals by pointing parameter variants to a single preferred URL while keeping the page crawlable. A metanoindex suits pages that serve users but should not appear in search, removing them from the index while still allowing link equity to flow.

By contrast, robots.txt stops crawling entirely, so search engines may keep a URL indexed from external links, but cannot see the canonical or noindex and cannot evaluate internal links. Reserve robots.txt for genuine crawl traps such as infinite calendars, session IDs, or faceted combinations that can explode into countless thin URLs.

A/B testing parameters

Experiment tags like ā€œ?variant=aā€ are useful during tests but should not live on in search engines. Canonicalise variants to the original or apply a meta noindex

After the assignment, store the variant in a cookie or session so visitors see the same experience while sharing clean URLs. Name tests clearly, keep them short, and remove test parameters at the end. For measurement, pair clean final URLs with Matomo’s A/B testing reports so results are easy to read.

Personalisation with parameters

Custom tags can enrich campaign data without exposing personal tracking information. Define a simple taxonomy for ā€œmtm_campaignā€, ā€œmtm_sourceā€, and ā€œmtm_mediumā€ and reuse ā€œmtm_contentā€ or another agreed-upon key for audience, creative or placement. 

Keep values short, lowercase and human-readable. Never pass personal data in URLs. If you need to include an internal identifier, use a non-reversible ID rather than an email. 

Strip tracking parameters from on-site navigation, log them once at entry, then use Matomo to carry the session forward. It preserves accurate attribution while keeping things clean.

Optimising URL parameters with Matomo

Matomo turns tagged links into clear, trustworthy reports without code. It uses its campaign tracking, flexible parameters and readable dashboards to move from guesswork to decisions.

Campaign tracking 

  1. Set a simple naming convention for mtm_source, mtm_medium, mtm_campaign, mtm_content and mtm_kwd.
  2. Build links with Matomo’s URL builderĀ so tags are added correctly.
  3. Add the tagged links to ads, emails and social posts before publishing.
  4. After launch,Ā check campaign reportsĀ to confirm clicks and conversions are recording as expected.
  5. For Google Ads, follow Matomo’sĀ guide to align auto-tagging, ValueTrack or manual tags so sessions are attributed correctly.

Tip: keep values short, consistent and free of personal data.

Custom parameters

Many sites already use parameter keys from other systems, such as utm_source, cid, src, or partner tags. Matomo can customise which keys it reads and map them to its campaign fields (for example, treat utm_source as Source and utm_term as Keyword), so historic links and third-party URLs report correctly without re-tagging. 

Matomo also supports mixing MTM and UTM parameters in the same URL. When duplicate keys are present (e.g., mtm_campaign=Summer%20Sale&utm_campaign=winter%20Sale), the first matching parameter is used. But if a user finds the website through a Google ad link, signs up for a newsletter and finally clicks an email link, Matomo can start a new visit to preserve accurate attribution for each campaign.

This keeps reporting consistent across platforms and teams while you move toward a single naming convention.

Custom reports and dashboards

Matomo’s reports make parameter data easy to act on. Watch traffic arrive in the Visits in Real-time widget, then open the Visits Log to inspect individual sessions and confirm tags. Use the Real Time Visitor World Map to spot geographic patterns.

Screenshot of Matomo reporting widgets

(Image source: Matomo)

Pin these widgets to a campaign dashboard, add a segment for a specific mtm_campaign, then compare performance week over week to inform future spend decisions.

Get started

Mastering URL parameters is crucial for accurate campaign tracking and informed decision-making. This playbook outlined the different types, marketing use cases, SEO pitfalls to avoid, and best practices for parameter optimisation.

Put this playbook to work with Matomo. Use the free URL builder to tag links, then read results in Campaign reports and dashboards to see which sources, creatives, and keywords drive visits and conversions.

Ready to craft effective, SEO-friendly URLs and measure their impact? Start your 21-day free trial of Matomo today.

Enjoyed this post?
Join the 160,000+ subscribers who receive the Matomo Newsletter straight to their inbox every month

Subscribe to our newsletter to receive regular information about Matomo. You can unsubscribe at any time from it. This service uses SendGrid. Learn more about it within our privacy Policy page.

Get started with Matomo

A powerful web analytics platform that gives you and your business 100% data ownership and user privacy protection.

No credit card required.

Free forever.

Get started with Matomo

A powerful web analytics platform that gives you and your business 100% data ownership and user privacy protection.

No credit card required.

Free forever.