UTM campaign link builder
Build a campaign URL with source, medium and campaign tags, while keeping existing query values and anchors.
A clear answer. Here’s how.
Adds the Google Analytics campaign parameters utm_source, utm_medium and utm_campaign, plus optional utm_id, utm_term, utm_content and utm_source_platform. Source, medium and campaign are required here. Surrounding whitespace is trimmed; case is preserved. Each value is limited to 256 characters without control characters. Replaces all existing instances of these exact lowercase parameter names; a blank optional field removes that tag. Other query parameter values, their duplicates and the fragment are retained. WHATWG URL and URLSearchParams serialize the URL, so spaces become + in query values and existing percent-encoding may be normalized. Accepts absolute HTTP/HTTPS URLs without embedded credentials. It never requests the destination or checks its availability. Creating a URL does not enable tracking: reporting requires the destination analytics setup and visitor consent. Keep personal information out of campaign tags.
How this is checked
3 reference checks passed These 3 cases were run when this page was built, on 3 December 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.
See the checks and where each expected answer comes from
Case 1
- Inputs
- Destination URL https://www.example.com/Campaign source (utm_source) summer-mailerCampaign medium (utm_medium) emailCampaign name (utm_campaign) summer-sale
- Expected, and what Toolmoz gave
- text expected https://www.example.com/?utm_source=summer-mailer&utm_medium=email&utm_campaign=summer-sale, Toolmoz https://www.example.com/?utm_source=summer-mailer&utm_medium=email&utm_campaign=summer-sale
- Where the expected answer comes from
- Google Analytics custom campaign URL example (summer-mailer, email, summer-sale).
- Allowed difference
- exact
Case 2
- Inputs
- Destination URL https://example.com/shop?item=1#offersCampaign source (utm_source) newsCampaign medium (utm_medium) emailCampaign name (utm_campaign) Winter SaleCampaign content (optional) A+B
- Expected, and what Toolmoz gave
- text expected https://example.com/shop?item=1&utm_source=news&utm_medium=email&utm_campaign=Winter+Sale&utm_content=A%2BB#offers, Toolmoz https://example.com/shop?item=1&utm_source=news&utm_medium=email&utm_campaign=Winter+Sale&utm_content=A%2BB#offers
- Where the expected answer comes from
- Form URL encoding uses + for a space and %2B for a literal plus; item=1 and the fragment remain.
- Allowed difference
- exact
Case 3
- Inputs
- Destination URL https://example.com/?utm_source=old&utm_source=older&utm_term=staleCampaign source (utm_source) newCampaign medium (utm_medium) emailCampaign name (utm_campaign) launch
- Expected, and what Toolmoz gave
- text expected https://example.com/?utm_source=new&utm_medium=email&utm_campaign=launch, Toolmoz https://example.com/?utm_source=new&utm_medium=email&utm_campaign=launch
- Where the expected answer comes from
- Replacing source leaves a single source tag; the blank optional term removes the stale tag.
- Allowed difference
- exact
What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- Destination URL
- https://example.com/shop?category=books#offers
- Campaign source (utm_source)
- newsletter
- Campaign medium (utm_medium)
- Campaign name (utm_campaign)
- winter_sale
- Campaign ID (optional)
- Campaign term (optional)
- Campaign content (optional)
- Source platform (optional)
Example result
https://example.com/shop?category=books&utm_source=newsletter&utm_medium=email&utm_campaign=winter_sale#offers
Copy the link into your campaign. Values are case-sensitive. Existing supported lowercase UTM tags are replaced; blank optional tags are removed. Other query values and the fragment are kept, with standard URL encoding. The destination is never visited. Analytics reporting depends on the destination site and visitor consent.