Which fields the script fills, and what to name them
The script fills a form input by its name, so a field it does not recognise stays empty. This page is the definitive list of the names it recognises, what each one holds, and the names it will not fill. Build your form against this page; to have MarqIQ add the fields to HubSpot or Marketo forms for you, read Add hidden fields to your forms.
How a field is matched
For every input on the page the script looks for a name it knows, in this order. The first match wins.
- A `data-marqiq-field` attribute on the input.
- The input's `name` attribute. Case does not matter.
- The input's `id`.
- A token typed as the input's default value, written `[utm_source_most_recent]` or `{utm_source_most_recent}`. This is the one handle Gravity Forms leaves you, because it names its inputs `input_7`.
- A class on the wrapper around the input, up to four levels up and no further than the form, and only when that wrapper holds exactly one control. This is the handle Pardot leaves you, because it names its inputs `1234_5678pi_...`.
Note
The last two rules guess from context, so they apply only to plain text-like inputs: `hidden`, `text`, `url`, `search`, or an input with no type. A checkbox, a select or a visible email box is never filled by a guess.
Every matching control on the page is filled, not only the first. A newsletter form in the header and a demo form in the body both get their values.
Most recent — the visit the form was submitted on
These change as the visitor comes back through a new campaign. They are read from the address of the current visit when it carries parameters, and from that browser's stored values otherwise. Stored values last 7 days, counted from the last visit MarqIQ could attribute — a tagged link, a Tracking URL rule, or a recognised referring site. A visit it cannot attribute does not extend them.
| Name the input this | What it holds | Example |
|---|---|---|
| utm_source_most_recent | Where this visit came from | |
| utm_medium_most_recent | How it reached them | cpc |
| utm_campaign_most_recent | The campaign | spring_sale |
| utm_content_most_recent | Which link inside the campaign | headline_a |
| utm_term_most_recent | The keyword bought | running+shoes |
| utm_campaign_id | The `utm_id` on the address of this visit. Read from the address only, and never stored, so it is filled only while the parameter is still on the URL | 71700000012345678 |
| entry_url_most_recent | The first page of this journey | https://example.com/pricing |
| current_url_most_recent | The page the form is on | https://example.com/demo |
| referral_url_most_recent | The address the visitor arrived from | www.linkedin.com/feed |
First touch — locked on the first visit, never changed
These hold whatever was resolved the very first time that browser saw your site, kept for a year. Nothing overwrites them, including a later tagged visit. There is no fallback to the address of the current visit, because a first touch is by definition not in it.
| Name the input this | What it holds | Example |
|---|---|---|
| first_utm_source | The original source | |
| first_utm_medium | The original medium | social |
| first_utm_campaign | The original campaign | launch_teaser |
| first_utm_content | The original content value | founder_post |
| first_utm_term | The original term | crm+attribution |
| first_entry_url | The first page ever landed on | https://example.com/blog/attribution |
| first_referral_url | Where they came from that first time | www.linkedin.com/feed |
| first_current_url | The page open when the snapshot locked | https://example.com/blog/attribution |
The same values under your tool's own names
These are alternatives, not extras. Use whichever set matches the fields your tool already has — the value in each row is identical to the one above it.
| Name the input this | Same value as |
|---|---|
| leadsource | utm_source_most_recent |
| lead_source_detail__c | utm_medium_most_recent |
| UTM_Source_Most_Recent__c | utm_source_most_recent |
| UTM_Medium_Most_Recent__c | utm_medium_most_recent |
| UTM_Campaign_Most_Recent__c | utm_campaign_most_recent |
| UTM_Content_Most_Recent__c | utm_content_most_recent |
| UTM_Term_Most_Recent__c | utm_term_most_recent |
| utm_source_first_touch | first_utm_source |
| utm_medium_first_touch | first_utm_medium |
| utm_campaign_first_touch | first_utm_campaign |
| utm_content_first_touch | first_utm_content |
| utm_term_first_touch | first_utm_term |
| UTM_Source_First_Touch__c | first_utm_source |
| UTM_Medium_First_Touch__c | first_utm_medium |
| UTM_Campaign_First_Touch__c | first_utm_campaign |
| UTM_Content_First_Touch__c | first_utm_content |
| UTM_Term_First_Touch__c | first_utm_term |
Thirty-four names in all, across this table and the two above it.
Names the script does not fill
Take care
The bare names `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`, `entry_url`, `current_url` and `referral_url` are not in the lists above. A hidden input with one of those names stays empty until you map it on Field mapping, which the next two paragraphs cover.
Those eight are the contract of the HTML forms guide in the sidebar, which is a separate, self-contained snippet for a site that does not run the MarqIQ script. Its own snippet fills them. Do not mix the two: pick the MarqIQ script and the names above, or that guide and its names.
To use the bare names, or any other name your CRM already has, map them on Field mapping. A mapped name is added to the script and reaches your site within about six minutes. Field mapping needs Pro or above. HubSpot and Marketo list their properties for you to pick from; for every other tool you type the field name into the Mapped Property box yourself.
What lands in the field
- A field whose value is not known is filled with a single hyphen, `-`. That is the script saying it has nothing, not a value you should report on.
- A `-` never overwrites something already in the input, so a value your page pre-filled survives.
- URLs are cut to 255 characters. A long address arrives shortened.
- Values are written through the browser's own setter and followed by input, change and blur events, so React, Vue and form engines with their own value model submit what was written rather than stale state.
- Filling happens when the page loads, again whenever the page changes, and once more as the form is submitted — so a form that appears late, or is redrawn after a failed validation, is still filled.
Note
With Wait for cookie consent on, no field is filled until the visitor's banner reports consent. A form submitted before then reaches your CRM without these values.
How these line up with your CRM
The field names above are what goes on the form. The properties they land in are named on Field mapping, where the same values are listed as UTM Source (Most Recent), UTM Source (First Touch) and so on.
Hidden form fields writes these onto your HubSpot and Marketo forms in bulk. It offers two groups, Most Recent (Last Touch) and First Touch, and selects Most Recent (Last Touch) to begin with.
Take care
HubSpot's public API blocks edits to forms built in HubSpot's new form editor, unless HubSpot turns that access on for your account. Hidden form fields marks those forms New editor, and a push to one comes back with that explanation instead of a change. Add the inputs in HubSpot's form editor by hand, and the script fills them as usual.
Next steps
Related articles
Was this article helpful?