# How to generate a UTM link: by hand, with Google's builder, and in a spreadsheet

> Generate UTM links three ways (by hand, with Google's Campaign URL Builder, with a sheet formula), plus copy-ready templates for email, social, ads and print.

Source: https://hoplytic.com/blog/generate-utm-link · Updated 2026-11-29 · Hoplytic Guides

Video version (75 seconds): [https://hoplytic.com/video/generate-utm-link.mp4](https://hoplytic.com/video/generate-utm-link.mp4)

## Video transcript

You need forty UTM links for next week, all named the same way, and none broken. How?

Start with the page URL. A question mark starts the parameters, or an ampersand if the URL already has one. Add source and medium, then campaign, and optionally content to tell links apart.

By hand is fine for one link. But a typo like utm soruce is silently ignored. Google's Campaign URL Builder suits a single link. Nothing stops one person typing Email and another e-mail. A spreadsheet is best for many. Use a formula, plus dropdowns for source and medium, so nobody invents new names.

The formula picks the question mark or ampersand, forces lowercase, encodes unsafe characters, and skips empty content.

Click the finished link once. The utm values should still be in the address bar. If you shorten the link, test the short version. And don't tag links between your own pages.

A UTM link can't see a sale on a merchant's site. For that you need a link that records the click itself. In Hoplytic, you can still add your UTMs. Every parameter is stored with the click.

The full guide is right below. Hoplytic: ad tracking made simple.

## Key points

- A UTM link is the page address plus a ? (or & if it already has one) and your utm_ parameters joined with &.
- Google's Campaign URL Builder is fine for a single link; a spreadsheet is better once you make more than a handful, because it enforces your naming list.
- In Google Sheets, ENCODEURL and a fixed list of sources and mediums prevent the two most common errors: spaces and inconsistent names.
- Always click the finished link once and check the parameters survive to the final page before you publish it.

You know what UTM tags are for. Now you need 40 of them for next week's campaign, all named the same way, and none broken. This guide shows how to generate a UTM link three ways and gives you templates per channel to copy.

**Short answer:** take the page URL, add `?` (or `&` if the URL already has a `?`), then `utm_source=`, `utm_medium=` and `utm_campaign=` with your values, joined by `&`. For one link, Google's Campaign URL Builder does this for you. For many, use a spreadsheet with a formula, so every link follows the same naming list.

## The anatomy you are building

`Page URL: https://yourshop.example/winter-boots
UTM parameters: ?utm_source=newsletter&utm_medium=email&utm_campaign=2026-w48&utm_content=top-button
Finished link: https://yourshop.example/winter-boots?utm_source=newsletter&utm_medium=email&utm_campaign=2026-w48&utm_content=top-button`

- **The separator:** `?` starts the parameters. If the page URL already contains `?` (like `/product?id=42`), use `&` instead.

- **Pairs:** each parameter is `name=value`, joined by `&`. Order doesn't matter.

- **Fragments last:** if the page has an anchor like `#sizes`, it goes at the very end, after the UTMs.

- **Safe characters:** lowercase letters, numbers, dashes and underscores need no encoding. Spaces, `&`, `#` and accented letters do.

What each tag means and how to choose values is covered in [UTM tracking explained](https://hoplytic.com/blog/utm-tracking).

## Method 1: type it by hand

Fine for a one-off. Start from the real landing page URL (open it in a browser and copy it from the address bar, so you get the final address, not one that redirects). Then:

- Check whether it already has a `?`.

- Add `?` or `&`, then `utm_source=yourvalue`.

- Add `&utm_medium=yourvalue&utm_campaign=yourvalue`.

- Optionally add `&utm_content=` to tell apart several links in the same place.

- Paste it in a browser and check the page loads with the parameters still in the address bar.

The risk is typos: `utm_soruce` is silently ignored. Past three or four links, switch to one of the next two methods.

## Method 2: Google's Campaign URL Builder

Google offers a free [Campaign URL Builder](https://ga-dev-tools.google/campaign-url-builder/). It has a field for the website URL and one for each campaign parameter: ID, source, medium, name, term and content. Fill them in and it writes the finished URL below, encoded correctly, ready to copy.

Good for: a single link, or checking you understand the format. Less good for: a team, because nothing stops one person typing `Email` and another `e-mail`. It also keeps no list of the links you made, so record them somewhere.

There is a separate builder for Google Play app campaigns. For website links, the web builder is the one you want.

## Method 3: a spreadsheet that generates UTM links

This is what most teams end up with. Set up a sheet with columns A to F: Page URL, Source, Medium, Campaign, Content, Finished link. In Google Sheets, put this in F2 and fill it down:

`=A2 & IF(ISNUMBER(SEARCH("?", A2)), "&", "?")
& "utm_source=" & ENCODEURL(LOWER(B2))
& "&utm_medium=" & ENCODEURL(LOWER(C2))
& "&utm_campaign=" & ENCODEURL(LOWER(D2))
& IF(E2 = "", "", "&utm_content=" & ENCODEURL(LOWER(E2)))`
What it does: picks `?` or `&` automatically, forces lowercase, encodes any unsafe characters with `ENCODEURL`, and leaves out `utm_content` when the cell is empty. Excel for Windows has an `ENCODEURL` function too, so the same formula works there with minor changes. It doesn't handle page URLs that contain a `#`; strip the fragment from column A first.

Two additions make the sheet enforce your rules:

- **Dropdowns for source and medium.** In Google Sheets, use Data, Data validation, and point columns B and C at a short list on another tab. Now nobody can invent `fb-ads`.

- **A date and owner column.** Six months later, you will want to know who made `utm_campaign=test2` and why.

## Templates per channel

Copy these and replace the campaign and content values. The sources and mediums follow GA4's default channel rules, so the traffic lands in the expected channel.

| Channel | Parameters to add |
| --- | --- |
| Newsletter | `utm_source=newsletter&utm_medium=email&utm_campaign=2026-w48&utm_content=top-button` |
| Organic Facebook post | `utm_source=facebook&utm_medium=social&utm_campaign=winter-boots&utm_content=post-1` |
| Instagram bio link | `utm_source=instagram&utm_medium=social&utm_campaign=bio-link` |
| YouTube description | `utm_source=youtube&utm_medium=social&utm_campaign=boots-review-video&utm_content=description` |
| Meta ads (URL parameters field) | `utm_source=facebook&utm_medium=paid-social&utm_campaign={{campaign.id}}&utm_content={{ad.id}}` |
| Partner or affiliate site | `utm_source=outdoor-blog&utm_medium=affiliate&utm_campaign=winter-boots` |
| Printed flyer via QR code | `utm_source=flyer&utm_medium=offline&utm_campaign=store-opening` |

Notes on a few of these:

- **Meta ads:** Meta replaces placeholders like `{{campaign.id}}` with the real value on each click. Put the parameters in the ad's URL parameters field rather than in the website URL. Other platforms use different placeholder syntax; see the [Meta macros](https://hoplytic.com/blog/facebook-ads-macros) page and the [full macro reference](https://hoplytic.com/blog/ad-platform-macros).

- **Google Ads:** with auto-tagging on and your account linked to GA4, you usually don't need UTMs at all. If you add them, GA4 still uses the auto-tagged source and medium. Tracking templates are covered in [Google Ads tracking templates](https://hoplytic.com/blog/google-ads-tracking-template).

- **QR codes:** `offline` isn't one of GA4's channel words, so this visit lands in "Unassigned". That is often what you want, because it keeps print separate. Pick one convention and stick to it.

## Check the link before you send it

- **Click it once.** The final page should load with all your `utm_` values still in the address bar. If they vanish, a redirect on your site is dropping them.

- **Look in real time.** In GA4, open Realtime and find your visit with the right source and campaign. Standard reports can take a day.

- **Check through a shortener.** If you shorten the link, test the short version, not the long one. A [redirect checker](https://hoplytic.com/tools/redirect-checker) shows every hop and whether the parameters reached the last one.

- **Don't tag your own internal links.** UTMs are for links from outside your site. Using them on links between your own pages overwrites where visitors really came from.

## When a generated UTM link isn't enough

A UTM link tells your analytics where a visit came from. It doesn't count clicks if the landing page has no analytics, and it can't tell you about a sale on someone else's site, such as an affiliate merchant. For those cases you need a link that records the click itself; the options are compared in [how to create trackable links](https://hoplytic.com/blog/trackable-links). If you use Hoplytic for that, you can still add your UTMs to the tracking link: every parameter is stored with the click, and with "Pass on other parameters" turned on they are forwarded to the destination page too.

## Questions people ask

### How do I generate a UTM link for free?

Use Google's Campaign URL Builder, type the parameters by hand, or build them in a free spreadsheet. All three produce the same kind of link; none needs an account.

### What if my URL already has a question mark?

Then add your UTMs with an ampersand instead: page?id=42&utm_source=newsletter. A second question mark breaks the parameters for many analytics tools.

### Can I shorten a UTM link?

Yes. Shorten the full link with the UTMs already on it. The shortener redirects to the long address, so the parameters arrive intact, as long as the shortener forwards the full URL.

### Where do UTMs go if the URL has a # in it?

Before the #. Anything after the # is a page fragment that browsers don't send as query parameters, so UTMs placed there are usually not read.
