Track Referrals with Hidden Form Fields
TL;DR:
- Add invisible hidden fields to forms to track where visitors come from
- Create custom URLs with query strings for different campaigns
- Use simple labels like "Source" to make tracking variables
- Check referral data in your form storage service like Google Drive or Mailchimp
Hidden form fields let you track where your visitors are coming from without cluttering up your forms. You can see which social media posts, email campaigns, or ads are actually bringing people to your site.
Setting Up Your Form
Start by adding a form block to your page. In the page editor, click an insert point and select Form from the menu.
Once your form is in place, click Edit Form Fields and then Add Field. Choose Hidden from the field types. This field won't show up on your form, but it will capture data behind the scenes.
Give your hidden field a simple label like "Source" or "Campaign". This creates a tracking variable called SQF_SOURCE that Squarespace will use to capture your referral data.
Customizing the Hidden Field
In the Value field, add some default text that gets sent when someone visits your page directly (without coming from a specific campaign). Something like "Direct" or "Unknown" works well here.
This default value is your fallback when no specific tracking information is available.
Creating Trackable URLs
Now you can create custom URLs for different campaigns. Add a query string to the end of your page URL using this format:
/?SQF_SOURCE=facebook
Replace "facebook" with whatever identifier makes sense for your campaign. You might use:
/?SQF_SOURCE=twitterfor Twitter posts/?SQF_SOURCE=newsletterfor email campaigns/?SQF_SOURCE=instagramfor Instagram stories
Keep your identifiers short and descriptive. They need to be under 100 characters, but shorter is better for sharing.
Testing Your Setup
Before you start sharing your trackable URLs, test them to make sure everything works. Log out of your Squarespace account (or open a private browsing window) and visit your page using the full URL with the query string.
Fill out your form and submit it. Then check your form storage service to see if the referral source appears correctly.
Viewing Your Referral Data
Your referral data shows up wherever your form submissions go. If you're using Google Sheets, you'll see a new column with your tracking information. If you're using Mailchimp, the data appears as a custom field.
This makes it easy to see which campaigns are actually driving form submissions, not just page views.
Advanced Tracking
You can track multiple pieces of information by adding more hidden fields or by using multiple query parameters. For example:
/?SQF_SOURCE=facebook&SQF_CAMPAIGN=spring2024
Just remember to create corresponding hidden fields for each parameter you want to track.
FAQs
Can I track multiple referral sources using hidden form fields?
Yes, you can add multiple hidden fields or use multiple query parameters in your URLs. Just make sure each parameter has a matching hidden field in your form.
How can I view the referral sources for form submissions?
Check whatever storage service you've connected to your form. The referral data appears as a new column or field alongside your other form responses.
Can I customise the default value for hidden fields?
Yes, the default value gets sent when someone visits your page directly without a query string. This helps you track general traffic versus campaign-specific visits.
Jargon Buster
Query String: The part of a URL after the question mark that contains tracking parameters and values.
Variable: A data placeholder that stores information. In this case, it identifies where your visitors came from.
Form Block: A Squarespace element that collects visitor information, which you can enhance with hidden tracking fields.
Wrap-up
Hidden form fields give you proper insight into which marketing efforts actually work. Instead of guessing which social media posts or email campaigns drive results, you'll have concrete data showing exactly where your form submissions come from.
The setup takes a few minutes, but the insights you gain will help you focus your marketing efforts on what actually works.
Ready to level up your Squarespace skills? Join Pixelhaze Academy for more advanced tutorials and expert guidance.