Learn · Campaign data · Updated 2026-08-14

How to add UTM parameters to a link

Add a question mark after the URL if it has none, or an ampersand if it already has parameters, then attach utm_source, utm_medium, and any other tags as key=value pairs joined by ampersands, with no spaces.

  1. Start with the destination URL
    Copy the exact URL you want the click to land on, including anything already after a question mark, since you'll need to know whether one is there before you add UTM tags.
  2. Decide which parameters you actually need
    utm_source and utm_medium cover most cases on their own; add utm_campaign for anything you'll want to report on later, and utm_term or utm_content only when you need that extra layer of detail.
  3. Check whether the URL already has a query string
    If the destination already contains a question mark and other parameters, your first UTM tag needs to start with an ampersand, not a second question mark.
  4. Build the parameter string with no spaces
    Join each utm_key=value pair with an ampersand, and never leave a literal space in a value, since spaces are exactly where links break when they get pasted into different apps.
  5. Encode special characters in your values
    Replace spaces with %20 or a hyphen, and encode anything else that isn't a letter, number, or hyphen, so the URL doesn't parse incorrectly on the receiving end.
  6. Test the finished link before you send it
    Paste the full link into a browser and confirm it loads the right page and that the parameters are still intact in the address bar after any redirect.
  7. Shorten or wrap it if it's going somewhere space-constrained
    A long tagged URL is unreadable in a caption, a QR code, or a printed flyer, so wrap it behind a short link that still preserves the tracking underneath.

The mechanics, in one line

Take the destination URL, add a question mark if it doesn't already have one or an ampersand if it does, then attach each parameter as utm_key=value, joining multiple parameters with ampersands and leaving no spaces anywhere in the string. That's the entire operation. Everything past this point is either detail on how to not break it, or what to do once the link is long enough that a person can't read it.

Step 1: start with the destination URL

Copy the exact URL the click should land on, not a shortened or previously-tagged version of it. If you're re-tagging an old link, strip any existing UTM parameters first rather than layering new ones on top; two utm_source values on the same link is undefined behavior in most tools and usually just means the first one wins, silently.

Step 2: decide which parameters you need

You rarely need all five. utm_source and utm_medium are the two that make a link meaningfully trackable at all. utm_campaign is worth adding on anything you'll want to report on as a distinct push later, which in practice is most things. utm_term and utm_content are for finer detail, a paid search keyword or a way to tell two nearly identical placements apart, and most links never need either.

ParameterAdd it whenExample value
utm_sourceAlways. It's the minimum needed to know where a click came frominstagram
utm_mediumAlways, alongside sourcebio
utm_campaignWhenever the link belongs to a specific push you'll want to isolate laterspring-sale-0301
utm_termPaid search links, to record the keyword that triggered the adrunning-shoes-sale
utm_contentTwo links are otherwise identical and you need to tell them apart, like a story vs a grid poststory-link

Step 3: check whether the URL already has a query string

This is the single most common way a hand-built UTM link breaks. If the destination is a plain URL like example.com/sale, your first parameter starts with a question mark: example.com/sale?utm_source=instagram. But if the URL already has one, for instance a product page like example.com/shop?variant=123, adding a second question mark instead of an ampersand overwrites or corrupts the existing parameter instead of adding to it. The correct version is example.com/shop?variant=123&utm_source=instagram, not example.com/shop?variant=123?utm_source=instagram. Skim the URL for a question mark before you touch it. If there's one already there, everything you add after it uses an ampersand, no exceptions.

Step 4: build the parameter string with no spaces

Chain each parameter with an ampersand and no gaps: ?utm_source=instagram&utm_medium=bio&utm_campaign=spring-sale-0301. Order doesn't matter functionally, most tools read all five regardless of position, but keeping a consistent order across your links makes them easier for a human to scan and check by eye.

Step 5: encode special characters in your values

A literal space in a value is where links quietly break. Depending on where the link gets pasted, a raw space can turn into %20, into a plus sign, or get the rest of the URL cut off entirely by whatever field it's pasted into. The safest habit is to never put a space in a UTM value in the first place: use spring-sale-0301 instead of "spring sale 0301." If a value genuinely needs a space, encode it as %20 rather than leaving it raw. The same goes for other special characters, ampersands, question marks, and slashes inside a value all need encoding or they'll be read as the start of a new parameter instead of part of the value you meant.

Step 6: test the finished link before you send it

Paste the complete URL into a browser's address bar and load it. Confirm two things: the page that loads is the one you meant, and the parameters are still sitting in the address bar afterward rather than getting stripped by a redirect somewhere in the chain. This takes fifteen seconds and it's the step people skip most often, right before finding out three days into a campaign that the link has been pointing at a delisted product page the whole time.

Step 7: shorten or wrap it if it's going somewhere space-constrained

A fully tagged URL with three or four parameters is routinely 80 to 150 characters, which is fine in an email footer and unusable in an Instagram bio, a QR code meant to be scanned from across a room, or a printed flyer. Wrap it behind a short link that preserves the tagging underneath rather than dropping it. This is also where a link-in-bio tool earns its place in the workflow: a Raydar link records the click itself, referrer and first-touch and last-touch data included, before forwarding the visitor on with the UTM parameters intact, so the short, scannable version and the tracked version are the same link instead of two things you have to keep in sync by hand. For the full mechanics of pointing a short link at your own domain instead of a generic one, see how to use a custom domain for short links.

Characters worth knowing how to encode

Most values only need letters, numbers, and hyphens, and if you stick to that you'll rarely think about encoding at all. But a few characters show up often enough to be worth knowing on sight, because each one has a specific meaning inside a URL that a raw, unencoded version will collide with.

CharacterWhy it's a problem unencodedEncoded form
SpaceGets read inconsistently across tools; can cut off the rest of the value%20 (or avoid it, use a hyphen)
&Reads as the start of a new parameter, splitting your value in two%26
?Reads as the start of the query string, breaking anything after it%3F
#Marks a page fragment; anything after it is invisible to the server and to UTM tracking%23
/Usually harmless in a value but best avoided to keep the URL readable%2F

The fragment character deserves a specific warning. If a UTM parameter accidentally ends up after a #, everything from that point on is a page fragment as far as the browser and most servers are concerned. It never reaches an analytics tool at all, because fragments are not sent to the server the way query parameters are. This is a genuinely common failure on single-page apps and some link-in-bio tools that use the URL fragment for their own internal routing. If tagged links keep disappearing from your reports on one particular destination, check whether your parameters are landing before or after a # in the final URL.

Adding UTMs from a phone, without a desktop tool

A lot of link tagging happens directly from a phone, pasting a link into an Instagram bio field or a caption with no desktop nearby. The mechanics don't change, but typos are more likely on a phone keyboard, particularly around the ampersand and question mark, which sit in a secondary keyboard layer on most mobile keyboards and are easy to mistype or skip. If you're tagging from mobile regularly, keeping a copy-paste template with placeholder values saved in your notes app, then swapping in the specific source and campaign, avoids retyping the full syntax from memory every time.

A before and after, on the same link

URL
Destination, untaggedexample.com/shop?variant=123
Wrong, second question markexample.com/shop?variant=123?utm_source=instagram&utm_medium=bio
Correct, ampersand after the existing parameterexample.com/shop?variant=123&utm_source=instagram&utm_medium=bio&utm_campaign=spring-sale-0301

The wrong version above isn't a hypothetical. It's the exact shape of the most common ticket a support team sees when someone says a tagged link is "broken." The page often still loads, since browsers are forgiving about malformed query strings, but the original variant parameter is gone, and whatever that parameter controlled, a size, a color, a discount code, silently reverts to a default.

Doing this without doing it by hand

Once you know the mechanics, the fastest way to stop making the ampersand mistake is to stop typing the query string yourself. A UTM builder takes the destination URL and your parameter values through separate fields and assembles the string correctly every time, including handling an existing query string without you having to remember the rule above. If you're setting up a naming pattern across a whole team rather than tagging one link, UTM naming conventions covers how to keep everyone's source and medium values consistent so the links you build this way stay comparable to each other months later. And if utm_source and utm_medium specifically are still unclear on which goes where, utm_source vs utm_medium covers that split directly.

Common questions

Do UTM parameters need to go in a specific order?
No. Analytics tools read all five parameters regardless of where they sit in the string. A consistent order across your own links just makes them easier to scan by eye.

What happens if I add UTM tags to a URL that already has parameters?
You need to use an ampersand instead of a second question mark. A second question mark is invalid and can overwrite or corrupt the existing parameter, which is the most common way a hand-built tagged link breaks.

Can I put spaces in a UTM value?
Avoid it. Use a hyphen instead, like spring-sale, rather than a literal space. A raw space gets encoded differently depending on where the link is pasted, which can truncate the value or split it into two.

Do UTM parameters change what page loads?
No. They're read by whatever tracking system is set up to look for them, but the destination page itself is unaffected. A URL with or without UTM tags loads the same content.

Is there a faster way than typing the query string by hand?
Yes, a UTM builder takes the destination URL and each parameter as separate fields and assembles the string for you, including handling the question-mark-versus-ampersand rule automatically.

Related: utm_source vs utm_medium: what goes where · UTM naming conventions that hold up after six months · How to use a custom domain for short links · How to see where your website traffic is actually coming from