Blog · UTMs and tracking

Capturing UTMs in HubSpot form hidden fields

Hidden UTM fields on a HubSpot form add little on pages that run the tracking code. On a form embedded on someone else's site, they are the only record you get.

Kurt Kalwin6 min read

A hidden UTM field on a HubSpot form copies utm_source, utm_campaign and the rest from the page address into contact properties when the form is submitted. On your own pages, where the HubSpot tracking code already reads the tags, that adds little. It earns its place when the form is embedded on a site that cannot run your tracking code, such as a partner's page, where it is the only source record you will get.

What the tracking code already records

If the form sits on a page with your tracking code, HubSpot reads the UTMs on the visit and files them into the Original Source drill-downs. How HubSpot reads UTM parameters has the mapping: for a tagged link in Other campaigns, Drill-Down 1 holds utm_campaign and Drill-Down 2 holds utm_source and utm_medium. That covers the question most people want answered, which is which campaign brought this person in first.

Hidden fields on that same page record a different thing: the tags on the page where the form was submitted, at the moment it was submitted. That gives you three things the drill-downs do not:

  • utm_term and utm_content as plain properties, which the drill-down mapping does not carry for Other campaigns.
  • The tags on the converting visit, which can differ from the first visit HubSpot ties to the contact.
  • Values that stay put if someone edits Original Source by hand and the drill-downs are cleared.

None of those change what an Original Source report says. If you already have hidden UTM fields on your own registration forms, keep them; they are cheap. If you don't, I would not set them up on a page that runs the tracking code just to have them. I would set them up the day a form leaves your domain.

Where hidden fields are the only record

A HubSpot form can be embedded on a page HubSpot does not host and that does not run your tracking code. HubSpot's page on embedding forms on an external site says that to track analytics for the form, the tracking code must be installed on the external page where you place it. The embed code can still receive submissions; site tracking is what goes missing.

What happens to those contacts is spelled out on HubSpot's page about more direct traffic than expected. One cause it lists is a contact who submitted a HubSpot form on a page without the HubSpot tracking code: HubSpot knows the submission came from a website visit but cannot categorise it. In practice those registrants pile up in Direct traffic with no campaign underneath.

The common cases from setup calls:

  1. A partner embeds your webinar registration form on their own site, as in UTM tags for a partner's newsletter and social posts.
  2. A landing page built in a separate page builder where nobody installed the HubSpot script.
  3. A microsite or event page on a domain your web team does not manage.

In each of these, the hidden fields are the only place the campaign will be written down. If you control the page, install the tracking code instead and check it with how to check the HubSpot tracking code is firing. That fixes Original Source, which hidden fields never touch.

How a hidden field picks up the tags

Two HubSpot features do the work together. The page on hidden form fields says hidden fields can capture URL parameters such as utm_campaign and store them in contact properties on submission. The page on auto-populating form fields with a query string says fields, hidden ones included, fill from a query string parameter named after the property's internal name, and it suggests custom UTM properties for exactly this.

So the parameter in the address has to be spelled exactly like the internal name of the property. A property called UTM campaign with the internal name utm_campaign fills from ?utm_campaign=.... A property whose internal name came out as utm_campaign_custom fills from nothing, however good the link is.

The hidden fields page lists two constraints worth knowing before you start. A field set as required cannot be hidden. And if the form has Pre-populate fields for returning visitors switched on, the hidden field's value may be overwritten, depending on the property's field type. On an embedded registration form I switch that option off.

The auto-populate page also says values with spaces must be written as %20, and that query strings cannot fill dependent fields. Keep UTM values lowercase with hyphens and neither one will come up.

Setting it up for a partner's embedded form

Here is the procedure, worked through on a made-up partner called Fernbrook who will embed your December webinar form on fernbrook.com.

  1. In Settings, Properties, create single-line text contact properties named UTM source, UTM medium, UTM campaign and UTM content. Open each one and confirm the internal name reads utm_source, utm_medium, utm_campaign and utm_content.
  2. Make a second registration form with the same visible fields and name it "Webinar registration: Fernbrook embed". A separate form per partner means a separate submissions count per partner.
  3. Add the four properties as fields, switch on Hidden field for each, and leave Required off.
  4. In the form's options, switch off Pre-populate fields for returning visitors.
  5. Copy the embed code and send it to Fernbrook with the page address you expect, such as https://fernbrook.com/events/december-webinar.
  6. Build the links Fernbrook will post in the UTM builder, for example ?utm_source=fernbrook&utm_medium=partner&utm_campaign=2026-12-attribution-webinar&utm_content=newsletter, and ask them to use those links to their own page.
  7. In HubSpot's tracking settings, add fernbrook.com as an additional site domain. The external embed page says submissions from domains that are not added are marked as spam.
  8. Once the page is live, open the tagged link in a private window, submit a test entry, and check that all four values reached the test contact.

Step 8 is not optional. The auto-populate page limits only the dynamic version, with personalization tokens, to HubSpot-hosted pages; plain values in the address are what you need here. But a partner's site can strip the query string on a redirect or wrap your form in something odd, and the test is the only way to know.

Say Fernbrook's newsletter sends 90 people to the page and 30 register. With hidden fields, a contact report on the Fernbrook form, broken down by UTM content, shows 30 contacts from the newsletter link. Without them, it shows 30 contacts in Direct traffic and an argument about where they came from.

Where hidden fields fall short

They only see the address of the page the form is on. If someone lands on fernbrook.com/blog with tags and clicks through to the event page, the tags are usually gone by the time they reach the form, and the fields stay empty. Ask partners to link straight to the page with the form.

They also store whatever was typed into the link. A partner who changes utm_source=fernbrook to Fernbrook gives you two values, and HubSpot will group them as two. Are UTM parameters case sensitive? covers the cleanup.

And they do nothing for Original Source. The contact still arrives under Direct traffic. Report the partner's numbers from the UTM properties or the form, not from the source report, and say so in the report description so nobody mixes the two.

Questions people ask

Do I need hidden UTM fields if the tracking code is on the page?

Not for source reporting. The drill-downs already hold the campaign, source and medium for tagged visits. Add them if you want utm_term as a property or the tags on the converting visit.

Can a hidden field hold a fixed value instead of reading the URL?

Yes. The hidden fields page describes a Default value setting that passes a value to the property on submission. On a partner's form you could set UTM source to fernbrook as the default, which helps if the partner refuses to use tagged links. HubSpot's documentation does not say which wins when both a default and a query string value are present, so test it if you plan to rely on both.

Will the hidden fields work on a form inside a Zoom registration page?

No. Zoom's registration form is not a HubSpot form, so there are no hidden fields to fill. If registration has to happen on Zoom, the tags stop at the click.