Form Setup
Set up SourceTag with HubSpot Forms
HubSpot Forms work differently from WordPress form builders. You need to:
- Create custom contact properties in HubSpot first
- Add those properties as hidden fields in the HubSpot form builder
- SourceTag populates them when the form is embedded on your site
What you need
- SourceTag installed on your website (where the HubSpot form is embedded)
- HubSpot account with access to contact properties and forms
Step 1: Create contact properties in HubSpot
Go to Settings > Properties in HubSpot. Create a new property for each SourceTag field.
For each property:
- Object type: Contact
- Group: Create a group called “SourceTag Attribution” (keeps things tidy)
- Field type: Single-line text
- Internal name: Match the SourceTag field name exactly
Properties to create
Core: st_fc_channel, st_fc_detail_1, st_fc_detail_2, st_fc_detail_3, st_fc_detail_4, st_lc_channel, st_lc_detail_1, st_lc_detail_2, st_lc_detail_3, st_lc_detail_4, st_fc_landing_page, st_lc_landing_page
Optional: st_fc_click_id, st_lc_click_id, st_visits, st_days_to_convert, st_device
[IMAGE: Screenshot of HubSpot property creation screen]
Step 2: Add hidden fields to your HubSpot form
Go to Marketing > Forms and edit your form.
- From the field panel on the left, drag a field onto the form
- Search for the property you created (e.g.
st_fc_channel) - Once added, click on the field and toggle Make this field hidden
Repeat for all SourceTag properties.
[IMAGE: Screenshot of HubSpot form builder with hidden field toggle]
Step 3: Embed the form on your site
Use HubSpot’s embed code to add the form to your website. The page must also have the SourceTag script installed.
SourceTag detects HubSpot forms when they load (using MutationObserver for dynamically embedded forms) and populates the hidden fields.
Step 4: Test
Visit the page with UTM parameters:
?utm_source=test&utm_medium=cpc&utm_campaign=hubspot-test Submit the form. In HubSpot, go to Contacts and find the test submission. Check the “SourceTag Attribution” property group for the data.
[IMAGE: Screenshot of HubSpot contact record showing SourceTag properties]
Important notes
- The HubSpot property internal name must match the SourceTag field name exactly. HubSpot sometimes modifies internal names (adds underscores, lowercases, etc.), so double-check.
- HubSpot forms embedded via the JS embed method work best. iFrame embeds may not work due to cross-origin restrictions.
- If you use HubSpot’s non-HubSpot form feature (tracking forms built outside HubSpot), the process is different. Use hidden fields in your external form builder instead.