gg
Home › Blog › What UTM parameters actually do to a link

What UTM parameters actually do to a link

2026-10-17 · 2 min read
seowebdata

A UTM link isn't a different kind of URL — it's an ordinary URL with extra query parameters tacked on, and analytics tools are simply configured to read those specific parameter names. Once you see it that way, building one by hand is just string concatenation with one rule to get right: how you join the parameters onto the URL depends on whether the URL already has a query string.

The method

  1. Start with the destination URL exactly as it should load — no tracking yet.
  2. Decide the values for the three core tags: utm_source (where the click comes from, e.g. newsletter), utm_medium (the channel, e.g. email), and utm_campaign (the specific push, e.g. launch).
  3. Percent-encode each value: a space becomes %20, and any character that isn't a letter, digit, or one of a small unreserved set gets replaced the same way, so a value with spaces or symbols can't be mistaken for a second parameter.
  4. Join the tags together with & between them: utm_source=X&utm_medium=Y&utm_campaign=Z.
  5. Attach that block to the URL: if the URL has no ? yet, add one before the block; if it already has a ? (an existing query string), add & instead so you extend the existing query rather than starting a second one.

A worked example

Destination: https://theggnetwork.com. Source: newsletter. Medium: email. Campaign: launch.

None of the three values contain a space or symbol, so percent-encoding changes nothing here. The tag block is utm_source=newsletter&utm_medium=email&utm_campaign=launch. The base URL has no ?, so the join character is ?, giving:

https://theggnetwork.com?utm_source=newsletter&utm_medium=email&utm_campaign=launch

Now change the campaign value to fall launch (with a space) and reuse a URL that already carries a query string, say https://theggnetwork.com/sale?ref=partner. The space in the campaign value encodes to %20, giving utm_campaign=fall%20launch. Because the base URL already has a ?, the join character is &, not a second ?:

https://theggnetwork.com/sale?ref=partner&utm_source=newsletter&utm_medium=email&utm_campaign=fall%20launch

Why the join character is the part people get wrong

A second ? in a URL isn't a second query string — everything after the first ?, including any later ? characters, is one query string, and most servers read a stray second ? as a literal character inside the first parameter's value rather than a new separator. That's the common failure mode: someone appends ?utm_source=... onto a link that already had ?ref=partner, and the resulting URL either mangles the ref value or drops the UTM tags, depending on what's reading it. Checking for an existing ? before you decide which character to prepend is the one branch in an otherwise mechanical process, which is exactly why it's the step worth doing deliberately rather than from memory.

The free UTM Link Builder does this same check-then-join-then-encode sequence in your browser — paste any URL, fill in the three tags, and it appends them with the correct separator and encoding automatically. Nothing is uploaded.

Try it free — with the steps shown

The UTM Link Builder runs in your browser and shows exactly how it got the answer, so the method sticks.

Open UTM Link Builder

More from the blog