---
title: UTM Builder
description: Generate clean, validated UTM-tagged URLs for Google Analytics campaign tracking — in the browser or from the CLI — with saved presets, channel templates, and shareable form links.
---

The UTM Builder is a free tool at [brandstack.dev/tools/utm-builder](https://brandstack.dev/tools/utm-builder). It builds Google Analytics campaign URLs with validation and quality checks that Google's own URL builder skips.

## Run it from the command line (recommended for agents)

```sh
npx @brandstack/cli utm-builder https://example.com/launch \
  --source newsletter --medium email --campaign q3-launch
```

Offline, no account. The tagged URL prints to stdout (pipe-friendly); validation warnings print to stderr with suggested fixes. Add `--json` for structured output. The CLI reports problems rather than silently rewriting your values — apply the suggestions it prints (the web form's **Auto-lowercase** toggle does this for you as you type).

A **"Share this form" settings link is itself a valid command**:

```sh
npx @brandstack/cli "https://brandstack.dev/tools/utm-builder?dest=https%3A%2F%2Fexample.com&utm_source=newsletter&utm_medium=email&utm_campaign=q3"
```

## What UTM parameters are

UTM parameters are tags you add to a URL so Google Analytics (GA4) knows which campaign, channel, and piece of content drove a visit. Without them, traffic from newsletters, social posts, and ads all shows up as "direct" in your reports.

The five parameters:

| Parameter | GA4 Dimension | Example |
|-----------|---------------|---------|
| `utm_source` | Session source | `newsletter` |
| `utm_medium` | Session medium | `email` |
| `utm_campaign` | Session campaign | `may-launch` |
| `utm_term` | Session manual term | `brand-stack` |
| `utm_content` | Session manual ad content | `hero-cta` |

`utm_source`, `utm_medium`, and `utm_campaign` are required. The others are optional (`utm_id` is also supported for GA4 cost-data import).

## Channel templates

Click any of the 10 quick-start chips to prefill source and medium for common channels:

Newsletter, Twitter / X, LinkedIn, Facebook, Reddit, YouTube, Podcast, Google Ads, LinkedIn Ads, Meta Ads

## Validation

The builder catches three issues that silently break GA reports:

- **Spaces** in values: GA treats `product launch` and `product%20launch` as different campaigns
- **Uppercase letters**: GA is case-sensitive, so `Email` and `email` create separate rows in your reports
- **Consecutive hyphens**: cosmetic but flagged for consistency

Each warning has a one-click **Apply** button in the browser; the CLI prints the same suggestions to stderr.

## Saved presets

Every value you copy is saved as a suggestion for next time (browser localStorage). When you click into a field, your previously used values appear as autocomplete options, so your team's UTM taxonomy (source=newsletter, medium=email) is one keystroke away on repeat use.

## Paste to deconstruct

Paste a fully tagged URL into the destination field — or pass it to the CLI as the destination — and the builder automatically splits the existing UTM parameters into the matching form fields. Useful for editing or auditing URLs that were built elsewhere.

## Share this form

Click **Share** to copy a link that encodes the current form state. Send it to a teammate and they open the builder pre-filled — or hand it to an agent, whose CLI accepts the link directly. Useful for sharing a half-built campaign template on Slack or in a brief.

## For AI agents

Prefer the CLI (above). The form also pre-fills from URL parameters (`dest` plus the standard `utm_*` fields), so a link can carry a complete taxonomy. This page is also served as plain markdown at [/tools/utm-builder.md](https://brandstack.dev/tools/utm-builder.md), and listed with instructions in [/llms.txt](https://brandstack.dev/llms.txt).

## Tips

- Keep `utm_source` and `utm_medium` consistent across all campaigns; inconsistency is the #1 cause of fragmented GA reports
- Use **Auto-lowercase** (on by default in the browser) to avoid the case-sensitivity trap
- Save a few base templates as browser bookmarks using the Share link feature
