UTM Builder

Add GA4-style UTM parameters to an absolute campaign URL while preserving unrelated query values and warning when an existing campaign parameter is replaced.

Browser-localFreeNo upload required

Tool workspace

Required fields: Base URL, utm_source, utm_medium, and utm_campaign.

Parsed UTM parameters

What this tool is for

Add GA4-style UTM parameters to an absolute campaign URL while preserving unrelated query values and warning when an existing campaign parameter is replaced.

How to use

  1. Enter the final destination URL and the exact source, medium, and campaign naming values used by your analytics plan.
  2. Add optional term or content values only when the campaign needs them.
  3. Build the URL, inspect preserved parameters and replacement warnings, then test the destination before publishing.

Example

Start with `https://example.com/page?ref=nav&utm_source=old`, set source to `newsletter`, medium to `email`, and campaign to `spring launch`, then confirm `ref=nav` remains and the old source is replaced.

FAQ

Does this shorten or test the URL?

No. It builds parameters locally; open the destination separately to test it.

Should names use spaces?

Consistent lowercase naming is easier to analyze. The tool encodes spaces but does not enforce your governance rules.

Reproducible examples

Known inputs and expected results

Run these examples in the workspace above and compare the result with the documented output.

Clean campaign URL

Input
https://example.com/landing
Options
source=newsletter, medium=email, campaign=autumn_launch
Action
Build the URL.
Expected output
https://example.com/landing?utm_source=newsletter&utm_medium=email&utm_campaign=autumn_launch
Explanation
Required UTM fields are encoded and appended to the destination query.

Preserve query and fragment

Input
https://example.com/landing?ref=nav#pricing
Options
source=linkedin, medium=social, campaign=b2b
Action
Build and inspect ordering.
Expected output
The result keeps ref=nav, appends the UTM fields, and retains #pricing after the query.
Explanation
A fragment remains last and unrelated parameters are preserved.

Error or unsupported case

Existing campaign conflict

Input
https://example.com/?utm_source=old
Expected error or limit
Replacing an existing UTM value without review can fragment analytics history.
Safer alternative
Choose an explicit replacement policy and verify the final redirect and GA4 dimensions.

When not to use this tool

  • Verifying GA4 collection or attribution
  • Choosing an organization's campaign taxonomy automatically

Algorithm and assumptions

The WHATWG URLAPI parses the base; URLSearchParams encodes values, preserves unrelated parameters and the hash, and handles existing UTM fields by the visible replacement rule.

Input and output

Input is an absolute destination URL and campaign fields. Output is a URL plus a parsed parameter summary and overwrite warnings.

Supported formats and behavior

  • Existing query strings and fragments
  • Required source, medium, and campaign fields
  • Optional term and content fields

Limits

  • No GA4 connection or campaign validation
  • Does not verify redirects or destination availability

Edge cases and common errors

  • Existing UTM values are overwritten with a warning
  • Fragments remain after the query string
  • Inconsistent capitalization creates separate analytics values

Release testing

Release checks cover required fields, existing parameters, overwritten UTM values, spaces, fragments, invalid URLs, copy, and clear.

Privacy boundary

The input and result stay in this browser session. ZZP Box does not upload or store the values entered in this tool.

Related reviewed tools

Choose the next tool by the operation you need, then review that page's stated input and limits.