What UTM tags are for
When someone lands on your site, analytics can usually tell which website sent them. It often cannot tell which email, which ad or which post they clicked. UTM tags fill that gap. They are extra parameters on the end of a link, for example:
https://example.com/spring-collection?utm_source=newsletter&utm_medium=email&utm_campaign=spring%20sale%202026
Google Analytics, Matomo, Plausible and most other tools read these tags and group visits by them. The name comes from Urchin, the analytics product Google bought and turned into Google Analytics.
How to use the UTM generator
- Paste the page address into Website URL. If you leave out
https://, it is added for you. - Fill in Campaign source, Campaign medium and Campaign name. These three are marked as required. Suggestions appear as you type in the source and medium boxes.
- Add Campaign ID, Campaign term or Campaign content if you need them.
- Copy the finished link from Campaign URL.
Two settings control how values are written:
- Spaces in values: keep spaces as
%20, write them as+, or replace them with_or-. - Lowercase values: on by default, so
Newsletterandnewsletterdo not end up as two rows in your reports.
Below the link, the tool lists each tag with the cleaned value, and warns you if a required field is empty.
The six fields
| Field | Parameter | What it records | Example value |
|---|---|---|---|
| Campaign source | utm_source |
Who sends the visit | newsletter, google, facebook |
| Campaign medium | utm_medium |
The type of channel | email, cpc, paid_social |
| Campaign name | utm_campaign |
The promotion or reason | spring_sale_2026 |
| Campaign ID | utm_id |
An ID from your ad platform or plan | abc123 |
| Campaign term | utm_term |
The paid search keyword | running shoes |
| Campaign content | utm_content |
Which ad or link inside a campaign | blue_banner |
Examples
These links come from running the generator.
| Input | Result |
|---|---|
Campaign “Spring Sale 2026”, spaces as %20 |
...&utm_campaign=spring%20sale%202026 |
Same, spaces replaced with _ |
...&utm_campaign=spring_sale_2026 |
Same, spaces as + |
...&utm_campaign=spring+sale+2026 |
| Lowercase values off | utm_source=Newsletter&utm_medium=Email |
| Campaign “Q4 & more” | utm_campaign=q4%20%26%20more |
Existing parameters and fragments are kept. The address example.com/shop?ref=home#reviews with source facebook, medium paid_social, campaign black_friday and content blue_banner becomes:
https://example.com/shop?ref=home&utm_source=facebook&utm_medium=paid_social&utm_campaign=black_friday&utm_content=blue_banner#reviews
How it works
The generator reads your address and splits it into three parts: the page, the query string and the fragment after #. It drops any old utm_ parameters from the query string and keeps the rest.
Each value is trimmed, repeated spaces are reduced to one, and the case and space options are applied. Then each value is encoded with the same rules as JavaScript’s encodeURIComponent, so characters such as &, # and ? cannot break the link. An & in a campaign name becomes %26, for example.
The tags go in a fixed order: source, medium, campaign, ID, term, content. The fragment goes back on the end, because anything after # is never sent to the server.
Naming tips
- Agree on a short list of mediums. Google Analytics 4 sorts traffic into default channel groups by medium, so values like
email,cpc,social,paid_social,referralanddisplayfall into the right group. A made-up medium such asblastends up as “Unassigned”. - Use one separator. Pick underscores or hyphens for multi-word names and stick to it.
- Keep it lowercase. The default setting does this for you.
- Write names people will understand later.
spring_sale_2026is clearer thanss26v2. - Keep a sheet of the links you make. It saves guessing next quarter.
- Do not put personal data in tags. Email addresses or names in a URL can end up in logs and reports.
Other ways to add UTM tags
Most email and ad platforms can add UTM tags automatically. In a spreadsheet, you can build links with a formula that joins the cells, such as =A2&"?utm_source="&B2&"&utm_medium="&C2, but you must encode spaces and symbols yourself, for example with ENCODEURL in Excel.
In JavaScript, the URL object can set parameters:
const u = new URL('https://example.com/spring-collection');
u.searchParams.set('utm_source', 'newsletter');
u.searchParams.set('utm_campaign', 'Spring Sale 2026');
That gives ...?utm_source=newsletter&utm_campaign=Spring+Sale+2026. Note that searchParams writes spaces as + and does not lowercase anything.
Related tools
To check or fix encoding in a link by hand, use the URL encoder and decoder. To turn a campaign title into a clean value, try the slug generator. For print, put the tagged link in a QR code and use a medium such as qr so scans show up separately.