đź’ˇ How do I add a hidden field to my form?

:bulb: CX Tips is part of our community tips series, where we post some of the most commonly asked questions we hear from ActiveCampaign customers. Have a new question? Start a new topic by clicking +New Topic in the upper right hand corner!

To add a hidden field to your form:

  1. Navigate to Website > Forms.
  2. Locate the form you wish to work with, then click the “Edit” button.
  3. 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.”
  4. Click the “Add a custom field” button.
  5. 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.

There are a few different ways to use a hidden field:

  1. 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.

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. More information can be found here.

  1. 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.

  1. 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.

  1. 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.