Form Setup
Set up SourceTag with Squarespace Forms
Squarespace’s native form blocks have limited support for hidden fields. The most reliable approach is to use a Code Block with a custom HTML form instead of the built-in form builder.
The limitation
Squarespace’s native Form Block does not expose a hidden field type or let you set custom name attributes on fields. This means SourceTag cannot populate fields in a native Squarespace form directly.
There are two workarounds:
- Code Block with custom HTML form (recommended) - full control over field names
- Third-party form embed - use a form builder that supports hidden fields (e.g. Tally, JotForm, Fillout) and embed it on your Squarespace page
This guide covers option 1.
What you need
- SourceTag installed on your Squarespace site (added via Settings > Advanced > Code Injection)
- A Squarespace page where you want the form
Step 1: Add a Code Block to your page
- Edit the page in Squarespace
- Click to add a new content block
- Choose Code from the block options
[IMAGE: Screenshot of Squarespace block picker showing the Code block option]
Step 2: Build your HTML form
In the Code Block, paste a custom HTML form. Here is a starting template:
<form action="https://your-form-handler-url" method="POST" id="contact-form">
<!-- Visible fields -->
<label for="name">Name</label>
<input type="text" name="name" id="name" required>
<label for="email">Email</label>
<input type="email" name="email" id="email" required>
<label for="message">Message</label>
<textarea name="message" id="message"></textarea>
<!-- SourceTag core hidden fields -->
<input type="hidden" name="st_fc_channel" value="">
<input type="hidden" name="st_fc_detail_1" value="">
<input type="hidden" name="st_fc_detail_2" value="">
<input type="hidden" name="st_fc_detail_3" value="">
<input type="hidden" name="st_fc_detail_4" value="">
<input type="hidden" name="st_lc_channel" value="">
<input type="hidden" name="st_lc_detail_1" value="">
<input type="hidden" name="st_lc_detail_2" value="">
<input type="hidden" name="st_lc_detail_3" value="">
<input type="hidden" name="st_lc_detail_4" value="">
<input type="hidden" name="st_fc_landing_page" value="">
<input type="hidden" name="st_lc_landing_page" value="">
<!-- SourceTag optional fields -->
<input type="hidden" name="st_fc_click_id" value="">
<input type="hidden" name="st_lc_click_id" value="">
<input type="hidden" name="st_visits" value="">
<input type="hidden" name="st_days_to_convert" value="">
<input type="hidden" name="st_device" value="">
<button type="submit">Send</button>
</form> Replace https://your-form-handler-url with your actual form handler endpoint. This could be a service like Formspree, Basin, Zapier Webhooks, or your own backend.
[IMAGE: Screenshot of Squarespace Code Block with HTML form pasted in]
Step 3: Style the form (optional)
You can add CSS within a <style> tag in the same Code Block to match your Squarespace site’s look and feel:
<style>
#contact-form label { display: block; margin-top: 1rem; font-weight: 600; }
#contact-form input, #contact-form textarea { width: 100%; padding: 0.5rem; margin-top: 0.25rem; border: 1px solid #ccc; }
#contact-form button { margin-top: 1rem; padding: 0.75rem 2rem; background: #000; color: #fff; border: none; cursor: pointer; }
</style> Step 4: Test
Visit the page with UTM parameters:
?utm_source=test&utm_medium=cpc&utm_campaign=squarespace-test Submit the form. Check your form handler for the submission data. The hidden fields should contain your attribution data.
[IMAGE: Screenshot of form submission data showing populated SourceTag hidden fields]
Tips
- Since you are using a Code Block, you have full control over the HTML. This is the same as the plain HTML form setup, just hosted on Squarespace.
- Make sure SourceTag is installed via Settings > Advanced > Code Injection > Header so it loads on every page.
- If you prefer not to build a custom HTML form, embed a third-party form builder (Tally, Fillout, JotForm, etc.) that supports hidden fields. See the relevant guide for that form builder.
- The Code Block approach bypasses Squarespace’s built-in form handling. You will need an external form handler to receive submissions.