Skip to main content

HubSpot attribution fields and iframe forms

Set up the Contact property from Flex​

In Flex, open the client, then Integrations → HubSpot → HubSpot attribution fields. Choose Recheck to inspect the connected account. An administrator can choose Set up tnt_id when the check confirms the property is missing and the connection has permission to create it. Opening the tab does not create properties or edit forms.

Flex creates an optional, non-unique text property through the existing HubSpot connection, then rechecks it. An existing incompatible property is left unchanged. Unavailable metadata or denied permissions are not treated as a missing property. Configured attribution-field precedence remains unchanged.

If permissions are missing, reconnect HubSpot using the connection controls and recheck. The connection needs Contact read/write and schema read access; property creation also requires crm.schemas.contacts.write. Bulk form setup requires the forms scope. The HubSpot app administrator must enable these scopes on the app before a reconnect can grant them. Ask the TNT operator to request the optional setup scopes in Flex's OAuth configuration, preserving the existing grants, then reconnect. Existing CDC connections keep their current default scopes.

Add the hidden field to existing forms​

Once a compatible Contact tnt_id property and Forms permission are verified, an administrator can choose Add hidden tnt_id to all forms. Review the account number in the confirmation: a shared parent connection affects that entire HubSpot account, including forms used by other clients sharing the account.

The background operation discovers non-archived forms, then adds an optional hidden Contact tnt_id field to forms that support HubSpot's Forms API. It preserves the other fields, field groups, consent settings and form configuration. Existing compatible hidden fields are skipped without another write. Existing visible, required, conflicting or nested tnt_id fields are left for manual review, as are unsupported form definitions. Running the action again is safe; run it again for forms created later. It is not an automatic rule for future forms.

The result shows added, already present, skipped and failed forms. Inspect the per-form reasons and recheck after permission or rate-limit failures. A partial result does not mean every form is configured.

Avoid editing forms while this operation runs: its revision checks and updates are separate API requests.

Let the pixel populate a HubSpot iframe form​

Install Flex Pixel on the page that embeds the form. Keep the existing consent and injection configuration, and opt in the embed or its wrapper:

<div data-tnt-track="true">
<!-- Place your existing HubSpot form embed here. -->
</div>

Alternatively, add .hs-form-frame to your existing formInjection.allow list. Keep selectors for other forms you use: a non-empty allow list restricts injection to its matching forms and embeds.

For newer HubSpot forms exposing window.HubSpotFormsV4, Flex uses the supported form-instance API to populate the existing 0-1/tnt_id field. It does not attempt to access the cross-origin iframe document. It handles forms already loaded when the pixel starts, form-ready events, multi-step navigation and a handle minted after the embed loads.

The form must expose a matching data-form-id host. If the same form is embedded more than once, every matching host must be opted in. Deny selectors, explicit opt-outs, disabled injection and tracking-consent restrictions still apply. Remote configuration settles before a value is written. Values supplied by the site are preserved; Flex only refreshes or retracts values it owns.

Form or embedHow the handle reaches it
Opted-in native or inline formExisting hidden-input injection
Opted-in HubSpot iframe with HubSpotFormsV4HubSpot's supported form-instance API; the field must already exist
Legacy HubSpot cross-origin iframe without that APIRequires an appropriate vendor callback or custom integration; this feature cannot populate it
TypeformExisting Typeform hidden-field carrier; see its separate setup requirements
Other cross-origin iframeRequires a provider-supported API or a cooperative bridge; parent-page DOM injection cannot reach it

This carrier sends tnt_id only. It does not claim to populate click IDs or UTMs inside HubSpot iframe forms, and it is separate from the optional _hsq.identify integration controlled by withHubSpot.

Verify a real submission​

Property readiness, a successful form edit and a value visible in the browser are different checks. In an authorized test account, submit through the actual embedded form and read the Contact back. Confirm its tnt_id matches the current visit, then verify that a later supported CRM outcome retains the attribution linkage.

Do not copy a handle between visitors or invent one for records without tracking consent. Missing tnt_id remains optional for conversion delivery; existing click-ID and CRM-only fallbacks still apply.

HubSpot references: Forms API and global form events and instances.