How to measure blog leads: UTM, submit event and hidden fields

A step-by-step guide to see how many leads your blog generates and where they come from: consistent UTM names, the form submit event in GA4 and Tag Manager, hidden fields with source and page, a check of the count, and privacy care under the GDPR, ePrivacy and US state laws.
Written with AI, reviewed by humans

In this article

See how your brand shows up in AI answers

Book a demo and find out what to fix first, with a GEO specialist.

Book a demo

Reading time: 12 minutes

To measure blog leads, define what counts as a lead, standardize the UTM on your links and send GA4 an event when the form is submitted. Then save the source and the page in hidden fields and compare the count with your CRM.

In short

  • Count a form submission as a lead, not a click on the invitation or the start of the form.
  • Write UTM in lowercase, with a few fixed source and medium values and no personal data.
  • Mark the submission as a key event in GA4 and save the source and page in hidden fields, so the CRM knows where each lead came from.
  • Compare the GA4 count with the form count every month, and investigate any jump in the gap.

What counts as a lead when you measure blog leads?

To measure blog leads, count a form submission as a lead, not a visit to the post or a click on the invitation. GA4 has the recommended generate_lead event, which Google defines as the record of a lead generated, for example through a form.

In this guide, a lead is a submission of the contact, quote or demo form. Newsletter sign-ups stay apart, because they weigh differently for sales. So agree on this with the sales team.

Two traps show up early. One is counting the start of the form, because people who give up are not leads. The other is counting the same submission in two events. So choose one event per form.

GA4 only sees people who click and reach the site. So to measure blog leads that came from AI without a click, also use the question how did you hear about us?

Measure blog leads: illustration of an article linked to a form and a chart of leads by source

How do you standardize UTM to measure blog leads?

Standardize UTM with a fixed vocabulary: a few utm_source and utm_medium values, always in lowercase. Also, each action gets its own utm_campaign. According to Google Analytics Help, the values are case-sensitive. So utm_source=google and utm_source=Google become separate rows in reports.

Always use utm_source, utm_medium and utm_campaign, because the missing ones produce the value “(not set)”. The table is our own template for blog links.

Where the link isutm_sourceutm_medium
Newsletternewsletteremail
LinkedIn post, no adlinkedinsocial
LinkedIn adlinkedinpaid_social
Partner postpartner-namereferral
Team email signaturesignatureemail

The medium column matters because GA4 classifies channels by it. In the default channel group definitions, the email medium leads to the Email channel, and social leads to Organic Social. A medium that starts with paid or contains cp, such as paid_social and cpc, becomes paid traffic when the source is a social network. Finally, the referral medium leads to Referral and, when no rule matches, GA4 uses Unassigned.

Three rules complete the model:

  • No personal data: Google prohibits email and other personal data in UTM, as the privacy section explains.
  • No UTM on internal links: UTM describes where the visitor came from, and a click inside the site is not a source.
  • One spreadsheet: keep the values in a spreadsheet and copy from it, because Google’s help itself recommends a strict naming convention.

How do you measure blog leads in GA4 and Tag Manager?

To measure blog leads in GA4, there are two paths. The first turns form_submit, already collected by enhanced measurement, into a key event. The second sends the generate_lead event through Tag Manager when the form confirms the submission and, for that reason, gives more control over what counts as a lead.

Path 1: form_submit as a key event

Google measures the submission of any form with the form_submit event. The help page on key events shows how to separate yours. In Admin, under Data display, click Events and then Create event. Give it a name, such as lead_form_submit, and use two conditions: event_name equals form_submit and form_name equals the name of the form. This value comes from the name attribute of the form tag in the HTML. So check in the source code that the form has this attribute. Then create the key event with the same name.

But the help page describes form_submit as the moment someone submits the form and does not mention server confirmation. So a submission with an error may count, and it is worth comparing with the saved entries.

Path 2: a Tag Manager event on confirmation

In Tag Manager, the form submission trigger has two options. Check Validation fires the tag only when the form is actually submitted, while without it the trigger fires on every attempt. Wait for Tags delays the submission until the tags fire or the timeout passes.

However, if the plugin changes the default submit behavior, as those that submit without reloading the page do, use the custom event trigger. The plugin or your own code pushes an event name to the data layer, and the trigger fires the tag:

window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ event: 'lead_sent', form_name: 'blog-contact' });

The tag is a GA4 event with the name generate_lead, and without a monetary value it doesn’t need currency. Another option is a thank-you page, which fires the event when someone visits it, with no personal data in the URL. The completion event varies by plugin, so check your plugin’s documentation.

On any path, mark only one event per form as a key event. After all, if form_submit and generate_lead are both key events, each submission becomes two leads in reports.

How do you save the source of blog leads in hidden fields?

Save the source in hidden fields of the form: one for each UTM, one for the entry page and one for the submission page. That way, each lead reaches the CRM with its own source, regardless of GA4. HubSpot documents the feature and says hidden fields capture URL parameters, such as UTM.

Create only the fields you will analyze, because privacy rules such as the GDPR call for the minimum necessary. The ones in the script below are utm_source, utm_medium, utm_campaign, utm_content, utm_term, entry_page, external_referrer and submission_page. In HubSpot, for example, if the option to pre-populate fields for returning visitors is on, the hidden value may be overwritten.

However, filling from the URL only works on the page that receives the UTM. If the visitor reads the post and opens the form on another page, the UTM is already gone. So the snippet below, our own, saves the values in the browser session and fills the fields on every page:

<script>
(function () {
  var KEY = 'lead_source';
  var UTMS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'];

  function readStored() {
    try { return JSON.parse(sessionStorage.getItem(KEY)) || {}; } catch (e) { return {}; }
  }

  function capture() {
    var stored = readStored();
    var url = new URLSearchParams(location.search);
    var hasUtm = UTMS.some(function (name) { return url.get(name); });
    if (stored.entry_page && !hasUtm) return stored;

    var fresh = { entry_page: location.origin + location.pathname, external_referrer: '' };
    if (document.referrer) {
      var host = new URL(document.referrer).hostname;
      if (host !== location.hostname) fresh.external_referrer = host;
    }
    UTMS.forEach(function (name) { fresh[name] = url.get(name) || ''; });
    try { sessionStorage.setItem(KEY, JSON.stringify(fresh)); } catch (e) {}
    return fresh;
  }

  var data = capture();

  function fill() {
    data.submission_page = location.origin + location.pathname;
    Object.keys(data).forEach(function (name) {
      var selector = 'input[name="' + name + '"], input[name$="[' + name + ']"]';
      document.querySelectorAll(selector).forEach(function (field) { field.value = data[name]; });
    });
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', fill);
  } else {
    fill();
  }
  new MutationObserver(fill).observe(document.documentElement, { childList: true, subtree: true });
})();
</script>

Paste the snippet on every page, in the theme footer or in Tag Manager. It saves the first page of the session and, for that reason, only replaces the values when a page in the session brings a new UTM. Fields can have a plain name or one ending in brackets, such as form_fields[utm_source]. But forms inside an iframe from another domain don’t accept filling, due to a browser rule, and sessionStorage lasts for one tab. So a lead who returns days later shows the new visit. We tested the snippet only in a browser. It was not tested in a real form plugin, in Tag Manager or in a GA4 account. So test it before you trust the numbers.

How do you check that blog leads arrive correctly?

Before you measure blog leads, run a test. Send a lead with a known UTM, see the event reach GA4 and check the hidden fields in the CRM. Exclude your own internal traffic, because the test is also a submission.

  1. Open the post with a test UTM: for example, ?utm_source=test&utm_medium=email&utm_campaign=form-test.
  2. Turn on Tag Manager preview, because it shows which tags fire on submission.
  3. Submit the form and, in GA4, open Reports and Realtime. The event should appear in the Key events by Event name card.
  4. Open the lead in the CRM and then check that the eight fields hold the test values. Finally, delete the test lead, so it doesn’t enter the account.

To take your team out of the numbers, see how to exclude internal traffic in GA4.

Why doesn’t the GA4 count match the form count?

The GA4 count rarely matches the form count, and the gap goes both ways. GA4 may count less when the visitor denies consent. On the other hand, it counts more when the submission is duplicated, fails validation or comes from the team. So compare over a closed period.

CauseEffect in GA4How to check
Consent deniedMay count lessCheck whether the banner uses consent mode
Once per sessionCounts lessCheck the counting method of the event
Duplicate eventCounts moreCheck in Tag Manager whether two events fire
Submission with an errorMay count moreCompare with saved entries, without spam
Internal trafficCounts moreApply the internal traffic filter
Lead without a formDoesn’t exist in GA4Separate the leads from other channels in the CRM

Two causes come from Google’s help. According to the consent mode documentation, when a person denies consent, tags send cookieless pings. Then GA4 fills the gaps with conversion modeling and behavioral modeling. The counting method also changes the total. Once per event, the recommended method, counts every trigger. Once per session, a legacy method, counts only one per session.

In the monthly routine, count the form entries of a closed month, without spam and without tests, and the key event in GA4. Then note the ratio between the two. The documentation doesn’t define an acceptable gap. So set yours from your history and investigate any jump. That way, you can measure blog leads with a number that sales trusts.

What do GDPR and ePrivacy mean when you measure blog leads?

This measurement joins browsing behavior, which goes to GA4, and lead data, which stays in the form and the CRM. The rules differ by region. This text is not legal advice, so ask a privacy lawyer about your case.

  • Google Analytics: Google’s policies prohibit data that Google could recognize as personally identifiable information, such as email addresses, personal mobile numbers and social security numbers. URL parameters, including custom campaign parameters, must be free of it. So no email in the newsletter link. Our rule: hidden fields stay in the form and the CRM, never in an event parameter.
  • GDPR: According to the European Commission, the purpose of processing must be known and the data limited to what is necessary. So keep only the fields you will analyze. In our reading, the privacy policy should say that the contact’s source is stored with the lead data.
  • ePrivacy: Under Article 5(3) of the ePrivacy Directive, the EDPB guidelines say that storing information on a visitor’s device, or reading information already stored there, is allowed only with consent or under a necessity exception. The rule reaches beyond cookies, and the exceptions depend on national law. A browser’s use of local storage isn’t access while the data stays on the device. But if the information, or anything derived from it, is accessed, the rule applies. Our snippet copies stored values into form fields that reach your server. So ask your lawyer whether it needs consent.

What do US privacy laws mean for lead tracking?

In the US, state laws set the rules, and thresholds vary. The California attorney general says the CCPA, as amended by the CPRA, covers for-profit businesses that do business in California and meet a threshold, such as gross annual revenue over $25 million (on the page as updated August 28, 2026).

A notice at collection must list the categories of data and the purposes. People can ask a business to stop selling or sharing their data, and a user-enabled global privacy control must be honored. “Sharing” refers specifically to cross-context behavioral advertising, so ask your lawyer whether your tags count.

Other states set their own terms. Connecticut’s attorney general, for example, says its act covers businesses that handled the personal data of at least 35,000 consumers, among other triggers, and that covered businesses must honor universal opt-out signals. So check each state where your visitors live.

How do you read the result after you measure blog leads?

Read the result in two layers. In GA4, the Traffic acquisition report shows the source and medium of the session, which come from the UTM. In the CRM, each lead carries the source saved in the hidden fields. The two may differ, because GA4 looks at the submission session, and the hidden field keeps the first page.

To find out which blog posts generate leads, cross the entry page with the key event in GA4. Then add those numbers to the attribution model and to SEO and GEO ROI.

People who arrive from AI with a click show up in the AI Assistant channel, as the guide to AI traffic in GA4 shows. Those who arrive without a click only show up in the declared answer of the lead. So to measure blog leads fully, add up GA4, hidden fields and the source question.

Want to know how your brand shows up in AI answers today?

Book a demo and see how your brand shows up in AI answers, with support from a GEO specialist.

Main sources

About this articleWritten with AI and reviewed by humans, with verified sources. Found something out of date? Write to the NotHuman team.

Get new NotHuman articles by email

By subscribing, you agree to receive blog articles by email and to the Privacy Policy. Unsubscribe any time.

Keep reading

Demo

Want to know how your brand shows up in AI answers today?

Book a demo and see how your brand shows up in AI answers, with support from a GEO specialist.

Book a demo

Your privacy

We use necessary cookies to make the site work and Google Analytics and Microsoft Clarity statistics cookies to improve our content. You can decline the statistics ones; in the EU, UK and Switzerland they are only turned on after you accept. Cookie Policy.

Cookie preferences

Cookie Policy