Skip to content
UTMCraftUTMCraft
UTM guide

URL Parameters, Encoding, and Fragments

Understand the parts of a campaign URL and safely encode a value without accidentally encoding the entire link.

By UTMCraft / Axellier · Updated · Examples use fictional campaigns.

Read a URL from left to right

In the example below, /classes selects a path, ? begins the query string, & separates query pairs, and #times identifies a fragment. The location and campaign values belong to the query. The fragment is a separate part of the address.

A campaign parameter placed after # is part of the fragment text, not an ordinary query parameter. Use the Builder to insert tracking values before the fragment instead of appending text to the end of the URL.

https://example.com/classes?location=colombo&utm_campaign=class_oct26#times

Encode a value, not every character of a finished link

A value such as pottery & glazing contains an ampersand that would otherwise look like a parameter separator. A URL API can encode it as part of the value. When building a link with UTMCraft, enter the readable value and let the builder encode it once.

The Encoder / Decoder is for inspecting an individual component. Encoding a whole URL produces text suitable for embedding as a value inside another URL; it is no longer a directly usable destination until decoded. Do not replace a finished link with its fully encoded representation by accident.

Readable value: pottery & glazing
Encoded component: pottery%20%26%20glazing
Query form: utm_campaign=pottery+%26+glazing

Check percent signs and repeated keys

If an already encoded value is encoded again, a percent sign can become %25. For example, %20 can become %2520. Decode one layer at a time and compare with the intended original text. Malformed percent sequences should be investigated rather than silently discarded.

Repeated keys can be intentional for filters, but repeated UTM fields are usually an editing mistake. The Parser shows every query value as well as duplicate key names. Preserve legitimate repeated functional values when editing campaign fields.

Compare semantic changes

A serialized URL may use a different but equivalent representation of spaces or characters. Compare decoded parameters before concluding that an encoding-only difference changes the campaign.

For an actual handoff, record the final URL as a single line. Email formatting, spreadsheet cell wrapping, or manually added spaces can introduce errors that were not present in the builder. Copy directly from the result and test the destination you control.

Before you publish

  • Insert campaign fields in the query, before the fragment.
  • Let the builder encode raw values once.
  • Use component encoding for values nested inside another URL.
  • Inspect every value of duplicate keys before changing them.

References and further reading

Our worked examples explain a workflow; platform behavior can change. Report a correction with a synthetic example.