Free tool — no signup

UTM code generator

Use this free UTM code generator to build consistent Google Analytics 4 campaign URLs. Add source, medium, campaign, optional content/term/id, apply channel presets, and copy a clean tagged link — in your browser, no signup.

UTM Code Generator preview

Input

Build a GA4 campaign URL in your browser. Drafts are not uploaded.

Channel presets

Hygiene options

Tagged URL

Live tagged URL, checks, and local history.

Run the utility to generate output in this panel.

  • No signup
  • Runs in your browser
  • Channel presets
  • Local session history

What a UTM code generator does

UTM parameters are query tags that tell analytics which campaign sent a visit.

This DilDigital builder appends utm_source, utm_medium, utm_campaign, and optional utm_content, utm_term, and utm_id to a destination URL so Google Analytics 4 can attribute the session.

People also call this a UTM builder, campaign URL builder, or GA4 UTM builder. The job is consistent tagging — not inventing vanity metrics.

The tool runs in your browser. It does not shorten links, sync ad accounts, or upload your campaign plan.

Source, medium, campaign — and the optional fields

Three fields do most of the work. The rest refine creative and imports.

utm_source names the platform or publisher (google, newsletter, linkedin). utm_medium names the channel type (cpc, email, social, qr). utm_campaign names the initiative (spring_launch_2026).

utm_content distinguishes creatives or link placements. utm_term is mainly for paid search keywords. utm_id helps when you import cost data into GA4.

Lock a small vocabulary for source and medium. Inventing a new medium for every campaign is how reports turn into mush.

Parameter Required? Examples
utm_source Yes google, newsletter, facebook, partner_acme
utm_medium Yes cpc, email, social, referral, qr
utm_campaign Yes spring_launch_2026, webinar_q2
utm_id Optional Stable ID for cost imports
utm_content Optional hero_cta, sidebar_link
utm_term Optional Paid keyword

How to use UTM Code Generator

Fill in the destination URL and the three required UTM fields. Presets fill common source/medium pairs so your team stays consistent.

Force lowercase and convert spaces to underscores to keep GA4 reports from splitting the same channel into near-duplicate rows.

Everything runs locally. Session history stays in this browser tab so you can copy recent links without uploading a campaign sheet.

Step 1

Enter the destination URL

Paste the landing page where the click should go. Existing query parameters and hash fragments are preserved.

Step 2

Pick a channel preset or fill UTMs

Use a preset for common source/medium pairs, then set campaign name plus optional content, term, and utm_id.

Step 3

Apply hygiene options

Keep force-lowercase and space-to-underscore on so GA4 does not split “Email” and “email” into different rows.

Step 4

Copy the tagged URL

Review checks and warnings, copy the URL into your ad, email, or QR workflow, and keep a shared naming sheet for your team.

Lowercase, spaces, and GA4 case sensitivity

Analytics stores the string you send. Case and spacing are not forgiven.

“Email”, “email”, and “EMAIL” become three different mediums. Prefer lowercase always.

Spaces become ugly encodings and inconsistent labels. Use underscores or hyphens — pick one separator style for the team.

This builder can force lowercase and convert spaces to underscores as you type.

Google Analytics Help: Collect campaign data with custom URLs

Never put UTMs on internal links

Internal UTMs overwrite the original traffic source.

If someone arrives from Google, then clicks an on-site link tagged with utm_source=homepage, GA4 may reattribute the session to that UTM instead of organic search.

Use UTMs only for traffic arriving from outside your site: ads, email, social posts, affiliates, QR codes, and partner placements.

Protect landing pages with a clean self-referencing canonical that does not include UTM parameters.

Real-world UTM URL examples

Compare clean tagged links with report-breaking ones.

✓ Good example

https://dildigital.com/example?utm_source=newsletter&utm_medium=email&utm_campaign=spring_launch_2026&utm_content=header_cta

✕ Case + spaces

https://dildigital.com/example?utm_source=Weekly%20Newsletter&utm_medium=Email&utm_campaign=Spring%20Launch%202026

Takeaway: The good link stays lowercase and separator-clean. The bad link fragments GA4 with spaces and mixed case.

✓ Good example

Use UTMs on the email CTA that points to /pricing. Leave in-site nav links untagged.

✕ Internal link tagging

Add utm_source=menu to every header link “for tracking.”

Takeaway: Internal UTMs overwrite original acquisition sources and destroy organic/paid attribution.

Best practices for UTM campaign URLs

Use these rules when you build links for GA4.

Require source, medium, and campaign

Those three fields power most acquisition reports. Fill them every time.

Force lowercase

Prevent Email vs email splits before they hit GA4.

Ban raw spaces

Use underscores or hyphens consistently.

Keep a medium vocabulary

Prefer cpc, email, social, referral, affiliate, display, qr.

Never tag internal links

UTMs are for external acquisition only.

Use utm_content for creatives

Separate hero CTA vs footer link without inventing new campaigns.

Add utm_id for cost imports

Help GA4 join spend to the right campaign when you import costs.

Preserve destination query params carefully

This builder appends UTMs and keeps existing params — confirm the base URL is already correct.

Keep canonicals clean

Landing pages should self-canonicalize without UTM query strings.

Document the convention

A shared sheet beats tribal knowledge when the team grows.

Campaign naming that stays readable

A shared convention beats another dashboard widget.

Date your campaigns when it helps (2026_03_spring_launch). Keep audience or offer tokens consistent across channels for the same initiative.

Store the convention in a simple sheet. Monthly, skim distinct source/medium values and merge near-duplicates before they pile up.

Common UTM mistakes

Most broken reports come from ordinary hygiene failures.

Mixed case, spaces, tagging internal nav, inventing one-off mediums, and forgetting campaign names all fragment attribution.

Another frequent miss: putting UTMs into the page’s canonical tag. Keep promotional query strings off the preferred SEO URL.

Publisher checklist before you spend

Run these checks after the tagged URL looks right.

  • Are utm_source, utm_medium, and utm_campaign filled?
  • Are all values lowercase with no raw spaces?
  • Does medium match your approved vocabulary?
  • Is this link for external acquisition (not internal nav)?
  • If needed, did you set utm_content / utm_term / utm_id?
  • Does the destination URL open correctly with existing params preserved?
  • Does the landing page use a clean self-referencing canonical without UTMs?
  • Did you save the naming choice to the team sheet?
  • If you shorten the link, did you shorten the final tagged URL?
  • Have you avoided inventing a one-off source spelling for this send?

UTM code generator FAQ

Straight answers for GA4 campaign URLs and tagging hygiene.

What are UTM parameters?

UTM parameters are standardized query tags (utm_source, utm_medium, utm_campaign, and optional fields) appended to a URL so analytics tools can attribute visits to a marketing campaign.

What is the difference between utm_source, utm_medium, and utm_campaign?

utm_source is the platform or publisher, utm_medium is the channel type, and utm_campaign is the specific initiative or promotion name.

Are UTM parameters case-sensitive in Google Analytics?

Yes. GA4 treats Email and email as different values. Always lowercase unless you have a deliberate exception documented for the whole team.

Should I add UTMs to internal links?

No. Internal UTMs can overwrite the original traffic source. Use UTMs only on links that bring people onto your site from outside.

Do UTM parameters hurt SEO?

UTMs create URL variants. Protect SEO by keeping self-referencing canonical tags on the clean URL without campaign parameters so tracking links do not become indexed duplicates.

What is utm_id used for?

utm_id is an optional campaign ID that helps when you import cost or offline data into GA4 and need a stable join key beyond the campaign name string.

What should I put in utm_content and utm_term?

utm_content differentiates creatives or link placements. utm_term is typically the paid search keyword.

How do I keep UTM naming consistent across a team?

Publish a short source/medium vocabulary, force lowercase in your builder, and review distinct values monthly for near-duplicates.

Does this UTM generator upload my links?

No. DilDigital builds the URL in your browser. Session history stays in the current tab’s sessionStorage and is not uploaded.

Can I use this for GA4 and Universal Analytics?

The same classic UTM parameters work for campaign tagging in GA4. Follow current Google Analytics guidance for collecting campaign data with custom URLs.

Should I URL-shorten tagged links?

Optional for social or print. Shorten only after the UTM URL is correct, and use a shortener you trust. This tool does not require a shortener account.

What medium values work well with GA4 channel groups?

Common clean values include cpc, email, social, referral, affiliate, display, and qr. Avoid inventing a new medium for every send.

What happens if I leave utm_campaign blank?

You will get weaker campaign reporting and more (not set) style gaps. This builder treats campaign as required alongside source and medium.

Do existing query parameters get wiped?

No. DilDigital appends UTM parameters and preserves existing query strings and hash fragments on the base URL.

How do UTMs relate to canonical tags?

Use UTMs on promotional links. Keep the page’s rel=canonical pointed at the clean preferred URL without tracking parameters.

Can I build QR code campaign links here?

Yes. Use a QR/print preset or set utm_medium=qr, then encode the finished tagged URL in your QR generator.

Is there a free Google UTM builder?

Google provides official campaign URL builder documentation and tools. DilDigital’s generator focuses on fast local hygiene, presets, and copy-ready output without signup.

Build your next campaign URL before you ship

Pick a preset, fill campaign name, review the checks, then copy a clean GA4-tagged link.