AAllMyToolsa pocketful of little tools
utm

UTM link builder

DevNo. 77 / 84

Build a campaign link from a base URL and five UTM fields, keeping the query parameters you already had and encoding the rest properly.

a link without utm parameters is just a link with a dream.

work surface

Math, not advice — results are indicative.Read the disclaimer.

most-used utilities

Newsletter button

Tag the one link in your email so the click lands in the email row instead of the direct traffic pile.

Social bio link

Give the link in your profile a source and a medium, then compare it against paid traffic honestly.

Printed QR code

Put a campaign on a poster and find out whether anyone actually scans it.

pro tips

Keep campaign names lowercase and identical everywhere. Spring_Launch and spring-launch are two different campaigns to an analytics tool, and neither one is happy about it.

Use one medium per channel: email, social, cpc, referral. Inventing a sixth medium because it felt right is how a report ends up with forty rows and one useful line.

Build the link, then click through it once. A campaign URL that 404s still collects data, which is technically a success and practically a problem.

what it does

Paste the page you want people to land on, fill in the UTM fields you care about, and the widget hands back the finished link. Query parameters already in the base URL stay where they were; the UTM ones are set or replaced by your fields, and empty fields are removed rather than left dangling with nothing after the equals sign.

This is the unglamorous plumbing behind every campaign report. A newsletter button, a profile bio link, a QR code on a poster, a partner's blog post: each one needs a distinct source and medium, or your analytics files them all under direct and shrugs.

Start with example.com/pricing?ref=newsletter, then add source newsletter, medium email and campaign spring_launch. The result carries four parameters: the original ref plus the three UTM ones. Leave term and content empty and they never appear, because an empty parameter is worse than no parameter at all.

The widget uses the browser's URL and URLSearchParams objects, so values are encoded properly: spaces become plus signs, and an ampersand or equals sign inside a value cannot break the link in half. A base URL without a scheme gets https:// in front. Only http and https are accepted, and the whole thing happens locally.

quick answers

Do UTM parameters affect SEO?

No. They change how analytics tools attribute a visit; search engines treat the page as the same page. The one thing to avoid is putting UTM links in your own site navigation, because that can reset attribution in the middle of a session.

Should I use spaces or underscores in campaign names?

Underscores or hyphens, never spaces. A space gets encoded as a plus sign in the final URL, which works but looks careless in a report. Pick one separator and keep using it.

What happens to parameters already in my URL?

Non-UTM parameters are preserved exactly. Any utm_source, utm_medium, utm_campaign, utm_term or utm_content already present is overwritten by the matching field above, or removed if that field is empty.