Learn why and how to use hidden form fields on your Form CTAs.
Before You Begin
- Hidden form fields are an optional feature that can be configured on Form CTAs. To learn about working with Form CTAs in general, see this article. In addition, you can find information and instructions specific to form fields in this article.
About hidden fields on Form CTAs
When you set up a Form CTA and customize the form fields that appear on it, you can choose among several different types of fields. Most of these are self-explanatory, such as text, dropdown, etc. But one that isn't quite as straightforward at first glance is the hidden field type. As the name suggests, a hidden field is unlike the other types because it's not user-facing. Instead, its purpose is to help automate tracking and attribution.
Here's how it works: whenever a visitor to your Hub submits a Form CTA, the data they entered into the form fields is used to populate a lead profile in your Marketing Automation Platform (MAP). In many cases, it can be really helpful to add contextual information to a lead profile, such as where the lead was referred from, or if the CTA they used was part of a particular campaign.
This is where hidden fields come in. You can use a hidden field to pass a value of your choice to a specified field in your MAP each time the CTA is submitted. This value can be a fixed text string (such as a campaign name, marketing persona, etc.), or you can automatically populate the hidden field with a URL query string (like a UTM string). In other words, you can use hidden fields to submit information with a CTA that the visitor would not submit themselves, and which can help you track related metrics like the effectiveness of your campaigns.
Set up a hidden field with a fixed value
The general process for creating a hidden field is exactly the same as for any other form field type, and is described in detail here. In this article, we will look only at configuring the options specific to hidden fields.
The simplest way to use hidden fields is to use a fixed value. You specify a value of your choice, and this same value gets passed through every time the CTA is submitted.
- Open the CTA Editor for the Form CTA on which you want to use hidden fields and open the Manage Fields menu (Form CTA Editor > Layout > Form Fields > Manage).
- Add a new field, and begin by using the Search box to locate the field in your MAP where you want to send the value from the hidden field. When you have the field you want, click on Apply. In the example below, we've chosen the Persona field in HubSpot to pass through a value representing the lead's marketing persona:
- If you want, use the Field label box to change the "display name" of this field, or leave it as the default (it'll only be visible to you).
- Under Field type, use the dropdown to select Hidden: You'll now see some additional options appear:
- Type the value you want to pass to your MAP into the Hidden value field. This is the value that will be sent to the MAP field you chose every time the CTA is submitted. In the example below, we want to send the value Demand Jenn to the Persona field in the MAP:
- Make sure the box next to Allow query string values to populate this field is left unchecked. This is used if you want to use a query string value instead of a fixed text value (see below).
- Click on Save to save your new hidden form field. Back in the Form CTA Editor, don't forget to check the box next to the field under the Form Fields section of the Layout tab, as it will be unchecked by default right after you add it:
- That's it! The fixed value will now automatically be passed to your MAP when a visitor submits this Form CTA.
Set up a hidden field with a query string parameter value
Alternatively, you can choose to automatically populate hidden fields with query string parameter values. To learn how to do that, see this article.