statistics, graph, chart-3411473.jpg

UTM link examples, naming conventions and best practices

A summary of the best tips I found when starting campaign tracking with matomo and utm query parameters. Do’s and Don’ts summarized.

Important note

I do not recommend using Google Analytics for website tracking. It will do a very good job for sure, but it violates all personal data privacy. I recommend the open source and privacy friendly Matomo project. It is free, try it out!

Useful Links

I don’t like duplicated content and you might have already googled about utm campaign tracking already. Here is a small list of posts, that I found useful:

Sorry the list is very short, as I did not save my bookmarks this time 🙁

Use UTM instead of MTM

When using Matomo (instead of google analytics) they suggest you to use mtm_campaign instead of utm_campaign. However they actually support both. If you ever switch to a different tracking solution, those links will be already set somewhere. I suggest going with the more common utm parameters.

Use dashes and lower case

For me this is obvious, but I want to repeat it: Do not use mixed case or underscores in utm parameters. Dash separates words are treated as multiple words, while an underscore word it interpreted as a single word. You can read more in this at the google docs.

For consistency it is important to stick with lower case wordings. This is how usually urls are formed. It feels natural and you cannot accidentally mix a campaign with upper and lower case.

How to track QR codes?

Here is an example of how I would track an QR code:

https://example.com/link-to-post?utm_medium=qr&utm_source=flyer&utm_campaign=summer-2022&utm_content=frontCode language: JavaScript (javascript)

While we come to more utm parameter examples later, I want to focus on the URL length: It is very long. I suggest adding a redirect of the following schema:

https://example.com/qr/1
https://example.com/qr/2
https://example.com/qr/3Code language: JavaScript (javascript)

What are the benefits?

  • The URL is way shorter, the QR code can be made smaller!
  • You can link to even more complex URLs
  • It still contains the top level domain (example.com), which is a) trusted by the user b) represents your brand. I would not use an URL shortener, use a redirect plugin for your content management system.
  • You can add a fallback, wildcard redirect to your website for a) upcoming qr codes b) old, outdated qr codes. The regex would be: https://example.com/qr/(.+) -> https://example.com Note that in RankMath you must add the fallback regex redirect first!
  • Note: I do not recommend using leading zeros, as you would limit your maximum numbers and it would look more awkward to me.
  • Make sure to not use the QR code for sensitive, secure data! If somebody knows the URL of QR code 5, he also knows the URL of code number 6!

Pro tip: The best QR code generator out there is definitely the one from Nayuki!

Keep track of launched campaigns

Note down the campaigns you’ve launched or the places where you’ve added utm parameters. Otherwise you will have a no overview about your data. There are commercial products for this available, otherwise use a simple csv file.

What about offline utm tracking?

You can either use subdomains (which requires maybe more server side setup) or a simple and short slug that is not used somewhere else. Then redirect this page to a dedicated utm tracking URL:

https://summer.example.com/ -> https://example.com/summer-sale?utm_medium=offline&utm_source=flyer&utm_campaign=summer-2022
https://example.com/summer -> https://example.com/summer-sale?utm_medium=offline&utm_source=flyer&utm_campaign=summer-2022Code language: JavaScript (javascript)

Parameter order

This is peanuts, but it makes sense to order the parameters. It has no technical use, it is just for you to better understand the usage for the parameters. Start with the medium (most unspecific) and end with the campaign (most specific).

Examples and naming conventions

Looking around quite some time I found some useful examples and naming conventions which I like to share.

E-Mail signature

You might want to add your homepage to the e-mail signature. Why not track how many people actually click it?

https://example.com/?utm_medium=email&utm_source=signature&utm_campaign=email-signature&utm_content=exampleCode language: JavaScript (javascript)

Print flyer

For print and offline mediums you can use the following schema:

https://example.com/?utm_medium=qr&utm_source=flyer&utm_campaign=summer-2022&utm_content=front
https://example.com/app/?utm_medium=qr&utm_source=flyer&utm_campaign=summer-2022&utm_content=backCode language: JavaScript (javascript)

Other utm_source you could use are:

  • poster
  • led-infowall
  • postcard

Newsletters

For newsletters I suggest setting utm_source to the name of the newsletter vendor and utm_campaign to the slugified name of the newsletter title, used by the newsletter software:

https://example.com/?utm_medium=email&utm_source=listmonk&utm_campaign=newsletter-7Code language: JavaScript (javascript)

Pro tip: Listmonk is a very nice and self-hosted open-source newsletter software. It is also free to use and well coded, maintained and documented!

Buy Me A Coffee

Leave a Comment

Your email address will not be published. Required fields are marked *