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

November 29, 2026 · Hoplytic team · 5 min read

The short version: this guide in 75 seconds.
Read the 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

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

What each tag means and how to choose values is covered in UTM tracking explained.

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:

  1. Check whether it already has a ?.
  2. Add ? or &, then utm_source=yourvalue.
  3. Add &utm_medium=yourvalue&utm_campaign=yourvalue.
  4. Optionally add &utm_content= to tell apart several links in the same place.
  5. 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. 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.

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:

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.

ChannelParameters to add
Newsletterutm_source=newsletter&utm_medium=email&utm_campaign=2026-w48&utm_content=top-button
Organic Facebook postutm_source=facebook&utm_medium=social&utm_campaign=winter-boots&utm_content=post-1
Instagram bio linkutm_source=instagram&utm_medium=social&utm_campaign=bio-link
YouTube descriptionutm_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 siteutm_source=outdoor-blog&utm_medium=affiliate&utm_campaign=winter-boots
Printed flyer via QR codeutm_source=flyer&utm_medium=offline&utm_campaign=store-opening

Notes on a few of these:

  1. 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.
  2. Look in real time. In GA4, open Realtime and find your visit with the right source and campaign. Standard reports can take a day.
  3. Check through a shortener. If you shorten the link, test the short version, not the long one. A redirect checker shows every hop and whether the parameters reached the last one.
  4. 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.

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. 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.

More in Tracking fundamentals

Also: tracking glossary · ad platform macros · Markdown copy