Form Setup
Set up SourceTag with FormAssembly
FormAssembly is commonly used in enterprise environments, often connected directly to Salesforce. It supports hidden fields (called prefill fields) that SourceTag can populate with attribution data when the form is embedded on your website.
What you need
- SourceTag installed on your website
- A FormAssembly account (any plan that supports web forms)
- The form embedded on your site — not hosted on FormAssembly’s domain
Important: embed method
FormAssembly forms can be hosted on FormAssembly’s own domain or embedded on your site. SourceTag needs the form to be on your site so it can access the form fields. Use the JavaScript embed or HTML embed method. Avoid the direct link (hosted) option.
Step 1: Open your form in the FormAssembly editor
Log in to FormAssembly and open the form you want to track in the form builder.
[IMAGE: Screenshot of FormAssembly form builder]
Step 2: Add hidden fields
- In the form builder, click Add Field (the field palette on the left)
- Find the Hidden field type and drag it onto your form
- Repeat for each SourceTag field you want to capture
[IMAGE: Screenshot of FormAssembly field palette showing the Hidden field option]
Core fields (add these)
Add a hidden field for each of the following:
st_fc_channelst_fc_detail_1st_fc_detail_2st_fc_detail_3st_fc_detail_4st_lc_channelst_lc_detail_1st_lc_detail_2st_lc_detail_3st_lc_detail_4st_fc_landing_pagest_lc_landing_page
Optional extended fields
If you have enabled extended field groups in your SourceTag dashboard, also add:
st_fc_click_idandst_lc_click_id(click IDs)st_visits(visit count)st_days_to_convert(days since first visit)st_device(device type)
Step 3: Set the field alias
For each hidden field:
- Click on the hidden field in the form builder
- Open the Properties panel (right side or below)
- Find the Field Alias (or Field Name) setting
- Set it to the SourceTag field name exactly (e.g.
st_fc_channel) - Leave the default value empty
The field alias controls the HTML name attribute when the form is rendered. SourceTag uses this to find and populate the field.
[IMAGE: Screenshot of FormAssembly hidden field properties with the alias set]
Step 4: Embed the form on your site
- In FormAssembly, go to Publish or Share
- Choose the JavaScript embed method
- Copy the embed code and paste it onto your page
The page must also have the SourceTag script installed.
<!-- Your site already has SourceTag -->
<script src="https://cdn.sourcetag.io/scripts/YOUR_ID/st.js" async></script>
<!-- FormAssembly JS embed -->
<script type="text/javascript" src="https://YOUR_INSTANCE.tfaforms.net/js/YOUR_FORM_ID"></script> If you are using an iframe embed, SourceTag will not be able to access the form fields due to cross-origin restrictions.
[IMAGE: Screenshot of FormAssembly embed options with the JavaScript embed selected]
Step 5: Test
Visit the page with UTM parameters:
?utm_source=test&utm_medium=cpc&utm_campaign=formassembly-test Submit the form. In FormAssembly, go to Responses and check the test entry. The hidden fields should contain your attribution data.
If your form is connected to Salesforce, also check the Salesforce record to confirm the data flowed through.
[IMAGE: Screenshot of FormAssembly response showing populated hidden fields]
Tips
- FormAssembly field aliases are case-sensitive. Copy the field names from the Fields page in your SourceTag dashboard (each name has a copy button).
- If your FormAssembly form posts directly to Salesforce via a connector, make sure the hidden fields are mapped to the correct Salesforce fields in the connector settings.
- FormAssembly’s prefill feature can conflict with SourceTag if you have set default values on hidden fields. Leave default values empty so SourceTag can populate them.
- For Salesforce-connected forms, you will typically need matching custom fields on the Lead or Contact object in Salesforce. See Set up SourceTag with Salesforce Web-to-Lead for guidance on the Salesforce side.