OneWebDesk

UTM Builder

Build trackable UTM URLs from campaign source, medium and name.

UTM parameters are the standard tags you append to a URL so that Google Analytics (GA4) can tell which channel a visitor came from — paid ads, newsletters, social posts and more. This UTM builder takes a base URL plus utm_source, utm_medium, utm_campaign and friends and generates a clean campaign tracking URL in real time.

Every value is URL-encoded automatically, and any existing query string or hash (#) on the base URL is merged correctly instead of being broken. That removes the typos, duplicate question marks and missing encoding you get when stitching URLs together by hand.

Fill in utm_source, utm_medium and utm_campaign.

The five UTM parameters

These are the standard UTM parameters GA4 understands. The first three should almost always be filled in.

  • utm_source: where the traffic came from. e.g. google, newsletter
  • utm_medium: the marketing medium. e.g. cpc, email, social, banner
  • utm_campaign: the campaign name. e.g. summer_sale, 2026_launch
  • utm_term: paid keyword (optional). e.g. running+shoes
  • utm_content: A/B test or creative variant (optional). e.g. top_banner, text_link

Consistent naming is everything

UTM values are case-sensitive. Google and google are counted as two different sources in GA4, which splits your data. Your reports stay clean when the whole team follows the same rules.

  1. Always use lowercase.
  2. Replace spaces with underscores (_) or hyphens (-) consistently.
  3. Maintain a shared, documented list of approved source/medium/campaign values.

Building the final URL

The tool safely encodes each value with encodeURIComponent, then appends only the UTM parameters while preserving any existing query string and hash on the base URL. Copy the finished link with one click and paste it into your ad platform or post. To go the other way and break an existing tracking link back into its parameters, use the UTM parser.

Recommended utm_medium values and GA4 channel mapping

GA4 reads your utm_medium value and automatically sorts the visit into a Default Channel Group. If you use a value it does not recognize, legitimate ad traffic ends up in Unassigned and your campaign reports look empty. Here are the medium values GA4 maps out of the box.

utm_medium valueGA4 channelWhere you use it
cpc, ppc, paidsearchPaid SearchGoogle/Bing search ads
display, banner, cpm, expandableDisplayGDN, banner ads
social, social-paid, smOrganic/Paid SocialInstagram, Facebook, X posts/ads
email, e-mail, newsletterEmailNewsletter / mail blasts
affiliateAffiliatesAffiliate/partner links
referralReferralLinks from other sites
(none) or emptyDirectTyped-in / bookmark

The point is that GA4 only auto-classifies exact keywords like email or cpc; a small variation such as mail or ppc-google breaks the mapping.

A worked example

Say you tag a summer-sale email with the values below, and the base URL already carries a query (?ref=top) and a hash (#offer):

  • Base URL: https://shop.example.com/sale?ref=top#offer
  • source newsletter / medium email / campaign summer sale 2026

The tool encodes the spaces and preserves the existing query and hash, inserting only the UTM parameters (the hash always stays at the very end):

https://shop.example.com/sale?ref=top&utm_source=newsletter&utm_medium=email&utm_campaign=summer%20sale%202026#offer

Notice the space encoded as %20. GA4 decodes the campaign back to summer sale 2026 in reports, but for readability and click-safety it is better to start with a space-free value likesummer_sale_2026.

Common pitfall

  • Putting UTM after the hash (#). Appending UTM behind a SPA hash route, e.g. example.com/#/page?utm_source=x, makes GA4 ignore it. UTM must live in the ? query section (before the hash), which is exactly where this tool places it.
  • UTM stripped by redirects. If a short URL or an http→https redirect drops the query string, your tracking disappears entirely. Open the final landing URL yourself and confirm the parameters survived.
  • Tagging internal links. Adding UTM to links within your own site restarts the GA4 session and miscredits direct traffic to a campaign. Only tag inbound entry links from external sources.

Frequently asked questions

Which of source, medium and campaign are required?
Technically all UTM parameters are optional, but for GA4 campaign reports to make sense you should always fill in source, medium and campaign. This tool requires those three.
Can I use spaces or non-Latin characters in values?
Yes. Values are URL-encoded automatically to produce a safe link. For readable reports, though, prefer lowercase ASCII and replace spaces with underscores.
What if my base URL already has a ? or #?
Existing query strings and hashes are preserved and the UTM parameters are merged in correctly, so you never get duplicate question marks or a broken fragment.
Is my URL sent to any server?
No. Everything runs in your browser; the URL and values you enter are never transmitted to any server.
Does capitalization matter?
Yes. GA4 treats UTM values as case-sensitive, so Email and email become different mediums. Standardize on lowercase across your team.

Related guides

Related tools