A hidden field can be used to pass information about contacts into your account when they submit your form. This field is not visible to your contacts. You can use a hidden field to collect information, such as UTM parameters, or even use it to help identify spam bot submissions.
Take note
- Hidden fields are text-only fields
- Hidden fields can only be used with Inline forms. Hidden fields cannot be added to floating box, floating bar, or modal forms
Create a hidden field
To add a hidden field to your form:
- Navigate to Website > Forms.
- Locate the form you wish to work with, then click the "Edit" button.
- The form builder will load. All editing and style options will appear in the right pane. Click the "Fields" option on the right pane then click "My Fields."
- Click the "Add a custom field" button.
- An "Add Field" modal window will open:
- Type the name of the field into the "Field name" field
- Click the "Group" dropdown then click the group that this field should belong to
- Click the "Field Type" dropdown and click the hidden field option
- Click the "Add" button
The field will be added to the Fields > My Fields section. You may need to scroll down the list of fields to see it. Once you locate the hidden field you just created, drag it to your form in the form builder.
Use hidden fields to collect information about your contacts
Now that you have added a hidden field to your form, you may be wondering how exactly that field will collect information about your contacts. There are a few different ways to go about this:
Add a query string to your form's URL
Adding a query string to your form's URL will add a fixed value to your hidden field.
For example, let's say I have a hidden field called “Hidden Field” in my form and the personalization tag for that field is %HIDDEN_FIELD%.
When a contact submits my form, I want that hidden field to display the value of “Test” on that contact's profile page.
To do that, I would need to fetch the personalization tag for that field (go to Contacts > Fields) and remove the percent (%) signs.
Then I would grab my form's URL: https://atestaccount.activehosted.com/f/15 and append it with this: ?hidden_field=Test so that the form URL now looks like this: https://acdemosarah.activehosted.com/f/15?hidden_field=Test
To pass UTM parameters into a hidden field, create a hidden field then modify its associated personalization tag to use an underscore. This will make it match the URL parameter.
Add a fixed value to your full embed code
After adding your hidden field to your form, copy and paste the full embed code for the form to your site. Then, insert your fixed value for that hidden field into your form's HTML code.
Add a dynamic value to your full embed code
When a form is submitted, you can add custom code to your site to dynamically “post” information to your hidden field. This option will require custom coding on your end.
Use hidden fields to help identify spam submissions
To use a hidden field to help identify spam submissions, all you need to do is add a hidden field to your form and leave it blank. You may want to label this hidden field “Spam” or “Spam Contact” to easily identify it later. Then, if your form is submitted with a value for that field, you'll know that a spam bot submitted your form and not an actual person.
It is important to note that this is not entirely foolproof as smart bots will not fill out a hidden field. The best way to protect your form from Spam submissions is to add a CAPTCHA challenge to your form and enable double opt-in.