Blog

UTM Parameters: Track Which Ad Every Lead Came From

Updated:

UTM parameters are labels in a link that tell your analytics where a visitor came from: Instagram, a newsletter or one specific ad. This guide covers the five parameters, how to build tagged links without mistakes and — the part most guides skip — how to make the source visible not only in a report, but on every single lead.

What UTM parameters are

They are query parameters at the end of a URL, after the ? sign. The visitor sees the usual page, while your analytics script reads the parameters and records where the visit came from:

A tagged linktext
https://example.com/catalog?utm_source=instagram&utm_medium=social&utm_campaign=black_friday&utm_content=stories_1

Without UTM tracking, analytics only sees the website the visitor came from — and often not even that: clicks from messaging apps, mobile apps and email clients arrive as "direct", with no source at all.

The five parameters

ParameterMeaningExample
utm_sourcePlatform: where the click came fromgoogle, instagram, linkedin, newsletter
utm_mediumType of trafficcpc, social, email, referral
utm_campaignCampaign or promotionblack_friday, spring_sale
utm_contentAd variant or link placementbanner_top, stories_1
utm_termKeyword in search adschat_for_website

The first three are required. Google Analytics 4 groups source and medium into channels: for example, utm_medium=cpc lands in "Paid Search" or "Paid Social", email in "Email". That is why it pays to use the common utm_medium values instead of inventing your own.

How to build UTM links without mistakes

  • Lowercase, no spaces. Use an underscore or a hyphen instead of a space. "Instagram" and "instagram" are two different sources for analytics.
  • One naming sheet for the whole team. Write down how you name platforms and mediums — otherwise in a month your report will have fb, facebook and FB.
  • External links only. Ads, social posts, newsletters, QR codes on flyers. Never tag links inside your own site — every click starts a new session.
  • Test the link before launch. Open it yourself and check that the visit shows up in the realtime report.

Ready-made examples

Where the link goessourcemedium
Instagram post or storyinstagramsocial
Facebook / Instagram adsfacebookpaid_social
Google Ads (search)googlecpc
Email newsletternewsletteremail
LinkedIn postlinkedinsocial
Partner site or influencerpartner namereferral
QR code on a flyerflyeroffline

How to see the source on every lead

An analytics report tells you how many people a campaign brought in. But the salesperson calling a lead needs to know where this person came from. For that, you have to save the parameters on arrival and send them with the form. The catch: people rarely submit a form on the page they landed on. They browse the catalog, open the contact page — and the parameters disappear from the URL.

The script below remembers first-touch parameters for 30 days and adds them as hidden fields to every form on the page. Your form handler receives utm_source, utm_campaign and the rest as regular fields:

Before the closing </body>html
<script>
  // First-touch parameters: kept for 30 days, not overwritten by a visit through a plain link
  (function () {
    var keys = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'];
    var params = new URLSearchParams(location.search);
    var found = {};
    keys.forEach(function (k) { if (params.get(k)) found[k] = params.get(k); });

    if (Object.keys(found).length) {
      found.saved = Date.now();
      localStorage.setItem('utm', JSON.stringify(found));
    }

    var stored = JSON.parse(localStorage.getItem('utm') || 'null');
    if (!stored || Date.now() - stored.saved > 30 * 864e5) return;

    // Add the parameters as hidden fields to every form on the page
    document.querySelectorAll('form').forEach(function (form) {
      keys.forEach(function (k) {
        if (!stored[k] || form.elements[k]) return;
        var input = document.createElement('input');
        input.type = 'hidden';
        input.name = k;
        input.value = stored[k];
        form.appendChild(input);
      });
    });
  })();
</script>

UTM tracking in Sitecog without code

If your site runs Sitecog, you don't need the script above: it saves the parameters the visitor arrived with during the current visit and attaches them to form leads and chat conversations. The condition is the same as for analytics: statistics collection must be allowed (where a cookie banner is required — after consent). Without it the lead still arrives, just without a source.

  • in the lead card — the source, medium and campaign the visitor came with;
  • in the chat — a visitor card: where they came from, UTM parameters, landing page, country;
  • in the traffic stats — a report by channels, sources, campaigns and sites;
  • on the Pro plan — a tagged-link builder for ads with a click count for each link.

Leads and traffic stats are included in the Basic ($29 per 30 days) and Pro ($79) plans. To get leads in Telegram as well, see website leads to Telegram. For a comparison of chat tools, see live chat for your website. If you are looking to replace Google Analytics itself, we compared seven tools in Google Analytics alternatives.

Frequently asked questions

What are UTM parameters in simple terms?

They are labels at the end of a link that tell your analytics where a visitor came from: utm_source is the platform, utm_medium is the type of traffic, utm_campaign is the campaign. The page itself does not change; only analytics tools and your CRM read them.

Which UTM parameters are required?

Three are usually enough: utm_source, utm_medium and utm_campaign. Without utm_source, Google Analytics cannot attribute the source. utm_content and utm_term are useful when you compare ads or keywords inside one campaign.

Do UTM parameters affect SEO?

Not if you only put them on external links (ads, social posts, newsletters). Never tag links inside your own site: every click would start a new session with a new source, and your reports would be wrong. For search engines, the page with and without parameters is the same page as long as it has a canonical tag.

How do I know which ad a lead came from?

Save the parameters the visitor arrived with and send them along with the lead, either as hidden form fields or through a CRM that does it for you. Then every lead shows the platform and campaign, not just the analytics report.

What is the difference between UTM and gclid?

Google Ads appends gclid itself when auto-tagging is on, and only Google Analytics and Google Ads can read it. You add UTM parameters yourself, and any system can see them: analytics, a CRM, your own script. For Google Ads you can use both.

Are UTM parameters case-sensitive?

Yes. Use lowercase without spaces: instagram, not Instagram. Analytics treats "Instagram" and "instagram" as two different sources, and your report splits in two.