UTM Link Builder (Campaign URL Builder)
Add UTM campaign tags to links, or split them out of existing URLs.
Use via API
Add UTM campaign parameters to a URL (replacing any existing ones, keeping other parameters and the #fragment), or parse the UTM parameters out of a tagged URL. Send JSON, get JSON back.
POST https://pithlab.com/api/v1/tools/utm-builder
curl https://pithlab.com/api/v1/tools/utm-builder \
-H "Authorization: Bearer $PITHLAB_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://shop.example.com/sale?ref=home#top","utm_source":"newsletter","utm_medium":"email","utm_campaign":"spring_sale"}'About the UTM Builder
Build campaign URLs with utm_source, utm_medium, utm_campaign and more. Keeps existing parameters and #fragments, warns about case and spaces, and parses UTM links.
How to use the UTM Builder
- Paste the page URL you want to link to, including https://.
- Fill in the campaign source and, ideally, the medium and campaign name. Term, content and ID are optional.
- Check the warnings. Lowercase values without spaces keep your reports tidy.
- Copy the finished link. Existing query parameters and any #fragment are kept, and old utm_ tags are replaced.
- To inspect a tagged link, switch to Parse and paste it to see each UTM value and the clean URL.
Examples
Input
https://example.com/shoes utm_source=newsletter utm_medium=email utm_campaign=spring_sale
Output
https://example.com/shoes?utm_source=newsletter&utm_medium=email&utm_campaign=spring_sale
Input
https://example.com/p?size=9#reviews utm_source=facebook utm_medium=paid_social utm_campaign=launch utm_content=video ad
Output
https://example.com/p?size=9&utm_source=facebook&utm_medium=paid_social&utm_campaign=launch&utm_content=video%20ad#reviews
Frequently asked questions
What do the UTM parameters mean?
utm_source is where the visitor came from (google, newsletter), utm_medium is the type of channel (cpc, email, social), and utm_campaign is the campaign name. utm_term records a paid keyword, utm_content tells apart links in the same campaign, and utm_id is a campaign ID.
Are UTM values case-sensitive?
Yes. Google Analytics reports Email and email as two different mediums. Pick a convention, usually all lowercase with - or _ instead of spaces, and stick to it. The builder warns you when a value breaks that.
What happens to parameters already in my URL?
Non-UTM parameters such as ?size=9 are kept exactly as they are, and a #fragment stays at the end where browsers expect it. Any utm_ parameters already in the URL are removed and replaced by the ones you enter.
Should I use UTM tags on internal links?
No. Tagging links between pages of your own site starts a new session in many analytics tools and overwrites the original source. Use UTM tags only on links from outside your site.
Is anything sent to a server?
No. Links are built and parsed in your browser, and nothing you enter leaves your device.