Formatting
A campaign URL is an ordinary link plus up to five parameters. Paste the landing page, fill in the fields you have, and the page sets utm_source, utm_medium, utm_campaign, utm_term and utm_content. https://shop.example/socks with source newsletter, medium email, campaign winter socks and content hero becomes https://shop.example/socks?utm_source=newsletter&utm_medium=email&utm_campaign=winter+socks&utm_content=hero.
The space in winter socks is a plus, because the parameters are written with the same form encoding as the query builder. Term was left empty, so utm_term is omitted rather than set to a blank value. At least one of the five fields has to be filled in. Existing query parameters on the landing page are kept, and a utm_ name you set replaces an older one of the same name.
The page does not check that the campaign exists in an ads account. It only builds the link. The cleaner is how you take those parameters off again later.
URL https://shop.example/socks. Source newsletter, medium email, campaign winter socks, content hero. Term empty.
https://shop.example/socks?utm_source=newsletter&utm_medium=email&utm_campaign=winter+socks&utm_content=hero
Blank fields are skipped. A utm_term= with nothing after the equals sign is noise, and analytics tools will treat it as a real term.
utm values are set through URLSearchParams. winter socks is written winter+socks, and parsers read that plus back as a space.
Those parameters stay. A utm_ key you fill in overwrites the same key if it was already there.
No. Empty fields are left out. One filled field is enough. All five empty is an error.
No. It writes the URL. Whether a product attributes the visit is up to that product.