Monitor your first website free, no card needed. Explore SENRIKO

UTM hidden fields empty? Why your form never receives the campaign

A lead came in from an ad, and its UTM fields in the CRM are empty. The cause is often outside the form itself: the visitor left the landing page for the catalogue, or the form was a widget embedded from another domain. To find the step where the campaign disappeared, follow it from the ad link to the moment the form is sent.

The path of UTM parameters from an ad link to a hidden form field
Contents
  1. What is a hidden input, and why is your UTM field empty?
  2. How do you check a hidden field?
  3. Two cases from our team’s work
  4. How do you fix empty UTM hidden fields?
  5. What does the UTM Survival Test see?

What is a hidden input, and why is your UTM field empty?

<input type="hidden" name="utm_source"> is a form field the visitor never sees. It is sent with the rest of the form and carries whatever value it holds at that moment. The browser does not put your UTM parameters into it: a script on the page, your tag manager or the form tool’s integration has to read the campaign and write it in.

So the campaign has a path to travel: the ad link with its UTM parameters, somewhere the site keeps them, the page with the form, the hidden field, and the submission. An empty value means one link of that chain broke. Start from the link visitors actually arrive on.

  1. Ad linkwith UTM
  2. Kept on the site
  3. Form page
  4. Hidden field
  5. Submission

How do you check a hidden field?

Open the ad link and reach the form the way a customer does, through the same pages. Checking the form page on its own misses the most common loss: the one that happens when the visitor moves on.

  1. Tag a test link

    Add utm_source=senriko-scan, utm_medium=senriko-check and utm_campaign=senriko-attribution to the landing URL, or your own test values. On every page after it, look for the parameters in the address bar or in the browser’s storage, the Application tab in Chrome DevTools.

  2. Read the field

    On the form page, list the hidden fields and their values. If the form sits in an iframe, note which domain it loads from and how it is meant to receive the campaign; pick that frame in the console’s JavaScript context drop-down before you run the line below.

    DevTools · Console
    [...document.querySelectorAll('input[type="hidden"]')]
      .map((field) => `${field.name} = ${field.value}`);
  3. Send a test lead

    If you can, submit a test lead. In the Network tab, open the form’s request and look at its payload, then find the lead in your CRM. Comparing the field, the request and the record shows where the value goes missing.

Note

Some form tools fill hidden fields only when the form is submitted, or on the server. An empty field before anyone presses the button is not, on its own, proof that the UTM parameters were lost.

Two cases from our team’s work

CaseAnonymous caseIndustrial ventilation

The form was on another page

What we saw
Ads sent visitors to the homepage of an industrial ventilation company, but they left their enquiry on an equipment page. Leads arrived in the CRM with empty UTM fields.
What we found
We followed the customer’s route and sent a test form. The script read the parameters from window.location.search only at the moment of submission, and on the product page the original UTM parameters were no longer in the address.
What was done
The campaign is now saved when the visitor lands from an ad, and the form on the next page reads it from storage. A fix like this needs its own lifetime and update rule: localStorage keeps data after the tab is closed.

CaseAnonymous caseSalon · promo page

The form was in a third-party iframe

What we saw
A salon’s promo page embedded a booking form from an outside service. The UTM parameters stayed in the landing page’s address, yet the test lead’s request carried empty utm_source and utm_medium fields. The Network tab showed it.
What we found
The widget loaded from another domain, so its script could not read the parent page’s address directly.
What was done
We passed the campaign through URL parameters the iframe supports, and the form picked it up from its own URL. Check this approach against your widget’s documentation.

How do you fix empty UTM hidden fields?

If the campaign disappears after navigation, capture it on the first page and hand it to the form wherever the form is. Decide two things first: how long to keep it, and whether a later visit with a new campaign replaces it (last touch) or not (first touch).

capture-utm.js
const KEYS = ['utm_source', 'utm_medium', 'utm_campaign'];

// Every page: keep the campaign the visitor arrived with.
const params = new URLSearchParams(location.search);
if (KEYS.some((key) => params.has(key))) {
  const campaign = Object.fromEntries(KEYS.map((key) => [key, params.get(key) ?? '']));
  localStorage.setItem('campaign', JSON.stringify({ ...campaign, savedAt: Date.now() }));
}

// The form page: fill the hidden fields the form already has.
const saved = JSON.parse(localStorage.getItem('campaign') ?? '{}');
for (const key of KEYS) {
  const field = document.querySelector(`input[type="hidden"][name="${key}"]`);
  if (field && saved[key]) field.value = saved[key];
}

This keeps the last campaign; for first touch, write only when nothing is stored yet. savedAt is there so you can drop a campaign older than the lifetime you chose. If a script draws the form after the page loads, run the second half once the form appears, or use the form tool’s own way of setting a field.

Safari keeps it for seven days

WebKit deletes all of a site’s script-written storage, localStorage included, after seven days of Safari use without interaction on the site. If your leads take longer than that to convert, keep a copy on your server as well, with the session or the lead.

For a form in an iframe from another domain, use the method the vendor supports: many form and booking tools accept campaign values as parameters of the embed URL and keep them in hidden fields of their own. Then walk the customer’s route again and look at the test submission. Start looking for the break on the pages you can reach with the UTM Survival Test.

What does the UTM Survival Test see?

SENRIKO’s free UTM Survival Test opens the page in a real browser, follows server, script and meta redirects, and reads the form fields and browser storage it can reach. It uses the test values senriko-scan, senriko-check and senriko-attribution. If the form is on another page, the test opens that page directly; it does not replay a visitor’s route through the menu.

It does not fill in or send the form, accept a cookie banner, or check gclid, fbclid, msclkid or delivery to your CRM, and the inside of a third-party iframe may be out of its reach. An empty field in its report is the field as it was when the test looked. Checking the submission and what happens after it takes monitoring on a site whose ownership you have verified.

Why are my UTM hidden fields empty?
Usually because the campaign never reached the form: the visitor moved to another page and the script only reads the current address, or the form sits in an iframe on another domain. Less often the field was renamed, or a form tool fills it only on submit.
Can a form in an iframe read the parent page’s UTM parameters?
Not when the iframe comes from another domain: the same-origin policy keeps its script away from the parent page’s address. Pass the values the way the widget supports, often as parameters of the embed URL.
Does an empty hidden field before submit mean the UTM parameters are lost?
Not on its own. Some form tools write the value on submit or on the server, so check the request the form sends, then the CRM record.
Does the UTM Survival Test send the form or check gclid?
No. It reads the fields and storage it can reach with its own UTM values. It does not fill in or send forms, check ad click IDs or see your CRM.

Who writes this

SENRIKO team

We build the checks SENRIKO runs on websites and write about the breakages they catch.

How SENRIKO works

Hear about a breakage before your customers do

SENRIKO checks the forms, tags and cookie consent on your site and writes when something stops working. The first site is free.

Start free