FormMaker docs
Guides

Add variables

Prefill fields, set hidden fields, and pass values like UTM or source into a form.

This page is about getting extra values into a hosted FormMaker form — a prefilled field, a hidden value, or campaign attribution. Some of that is automatic; some of it the widget doesn't do yet. Here's exactly what's real.

The embed, in full

A hosted form is embedded with one element and one script:

<formmaker-form data-formid="hf_xxx" data-key="fm_pub_xxx"></formmaker-form>
<script src="https://formmaker.co.in/embed/formmaker.js" async></script>

The element reads exactly three attributes: data-formid, data-key, and an optional data-base (it defaults to https://formmaker.co.in). There is no attribute for setting a field's value — the fields are defined on the form itself, not on the embed.

UTM and source — automatic, nothing to add

You do not add UTM or source as form fields. Every submission already carries a context with:

  • pageUri — the full URL of the page the form was filled on, query string and all. Put your form on https://you.com/lp?utm_source=newsletter&utm_campaign=july and that whole URL travels with the submission.
  • pageName — the page's title.
  • hutk — the visitor's HubSpot tracking cookie (hubspotutk), when present. This is what ties the submission to their analytics session, so HubSpot can attribute original source and campaign.

So campaign attribution works by putting the form on a URL that carries the parameters. Nothing to configure.

Prefilling a field from the URL

Not supported today. The widget starts every field empty and never reads query-string parameters into field values. A ?email=... in the URL will not fill the email field.

There is no URL-prefill mechanism to work around — a visitor fills the fields themselves. If you need a value recorded without asking for it, capture it as attribution (above) rather than as a field.

Hidden fields

Not supported today. There is no hidden field type — fields render as text, email, phone, textarea, dropdown, radio, checkbox, or date. A field hidden by conditional logic is also dropped from the submission, so you can't use one to smuggle a constant value through.

Use the automatic context above for things like source and page. For a genuine per-submission value you want stored, add a real, visible field.

Conditional fields

Some templates (for example branching-intake) show or hide a field based on an earlier answer. That's answer-driven and defined on the form — not something you pass in from the page or the URL.

See also