UTM campaign link builder

Tag any URL with UTM parameters so your analytics can tell you exactly which campaign, channel and link brought each visitor.

UTM Campaign Link Builder

Build tracking links for newsletters, social posts and ads — so Google Analytics can tell you exactly which campaign brought each visitor.

Tracking Link

Tagged URL

How to use this tool

UTM parameters are tags appended to a URL that analytics tools read on arrival. Without them, visitors from your newsletter, a partner blog and a paid post all collapse into vague buckets like "direct" or "referral" — and you lose the ability to tell which effort actually worked.

They're invisible to the visitor's experience and don't affect the page they land on. The five standard parameters are utm_source, utm_medium, utm_campaign, utm_term and utm_content, and they've been the de facto standard since Urchin — the "U" in UTM — became Google Analytics.

Source, medium and campaign: the three that matter

Source is where the link lives: newsletter, twitter, partner-blog. Medium is the type of channel: email, social, cpc, referral. Source and medium are the pair analytics reports are built around, and both should be on every tagged link.

Campaign groups links that belong to the same initiative — spring-launch, black-friday — so you can measure the whole effort across channels. Term is for paid keywords, and content distinguishes variants: use it to tell a header button from a footer link in the same email, or version A from version B in a test.

Consistency matters more than cleverness

UTM values are case-sensitive in most analytics platforms. Email, email and E-mail become three separate rows in your reports, splitting the data for the same channel — which is exactly the confusion you adopted UTMs to avoid. This builder lowercases values and converts spaces to hyphens automatically for that reason.

Agree a naming convention before you start tagging and write it down. A short shared document listing your approved mediums (email, social, cpc, referral, display) and how campaigns are named will save you far more time than it costs.

Two mistakes worth avoiding

Never tag internal links. Adding UTM parameters to links between pages on your own site overwrites the visitor's real source. Universal Analytics started a new session when it saw one; GA4 no longer splits the session, but it still credits later conversions to your internal "campaign" instead of the channel that actually brought the visitor. Use internal link tracking or events instead.

Be careful with tagged URLs in indexable places. If a tagged link gets crawled and indexed, you can end up with duplicate URLs for the same page competing in search. A self-referencing canonical tag on the clean URL protects against this — the meta tag generator produces one.

Tagged links are also long and ugly. For anything a human will see — printed material, social bios, spoken URLs — run the tagged link through a shortener, which preserves the parameters through the redirect.

Passing campaign data into your own forms

Google Analytics reads UTM parameters itself, so you need no code for campaigns to appear in its reports. You need your own capture when the conversion is recorded somewhere analytics cannot see, such as a CRM lead, a back-end order or a support ticket, and you want the campaign stored with it.

const UTM_KEYS = ['utm_id', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'];

function readUtms(href) {
  const params = new URL(href).searchParams; // decodes %20 and + for you
  const utms = {};
  for (const key of UTM_KEYS) {
    const value = params.get(key)?.trim();
    if (value) utms[key] = value.toLowerCase();
  }
  return utms;
}

// In the browser: keep the first tagged landing for this tab, so a later
// untagged page view doesn't wipe it, then copy it into hidden form fields.
// const found = readUtms(location.href);
// if (Object.keys(found).length && !sessionStorage.getItem('utms')) {
//   sessionStorage.setItem('utms', JSON.stringify(found));
// }

console.log(readUtms(
  'https://example.com/pricing?utm_source=Newsletter&utm_medium=email' +
  '&utm_campaign=spring+launch&utm_content=&gclid=abc123'
));
// { utm_source: 'newsletter', utm_medium: 'email', utm_campaign: 'spring launch' }

The details that trip people up:

  • Read the URL with URL and URLSearchParams, not a regex. They decode %20 and + to spaces and do not care about parameter order.
  • Keep the first touch. Store the values once and do not overwrite them when the visitor moves on to an untagged page; that is the usual reason CRM records arrive with no source. localStorage lasts beyond the tab, but storing data on the device may need consent under UK and EU cookie rules.
  • Lower-casing here does not fix GA. GA4 treats Google and google as different values, so normalising in your capture code keeps the CRM tidy but will not merge split rows in Analytics. Fix the links themselves.
  • Do not strip the parameters too early. Tidying the address bar with history.replaceState() before the analytics tag has read the URL loses the campaign in Analytics as well.

Google lists every supported parameter, including the newer utm_id and utm_source_platform, in URL builders: Collect campaign data with custom URLs.

Frequently asked questions

What is the difference between utm_source and utm_medium?

Source is where the link lives — newsletter, twitter, a specific partner site. Medium is the type of channel — email, social, cpc, referral. Source answers "which one" and medium answers "what kind", and analytics reports are built around the pair.

Are UTM parameters case-sensitive?

Yes, in most analytics platforms. Email and email are recorded as two separate sources, splitting your data. Always use lowercase — this builder converts values automatically for that reason.

Should I use UTM parameters on internal links?

No. Tagging links between pages on your own site overwrites the visitor’s real source: Universal Analytics started a new session, and GA4 credits later conversions to the internal tag instead of the channel that brought the visitor. Use internal link tracking or custom events instead.

Do UTM parameters hurt SEO?

Not directly, but tagged URLs that get indexed can create duplicate versions of the same page in search results. A self-referencing canonical tag on the clean URL prevents this.