Hidden values let you store information such as a campaign ID or staff member’s name by pulling it from the query string in your form’s URL. These values are only visible in your reporting and form responses, and never shown on the form itself. This is especially useful when you want to personalise or route form submissions without creating multiple versions of the same form.
Before you start
Things you need to know:
To use hidden values, you must plan to share your form using the URL link only, and not embedded or as a pop-over.
Query strings explained
The query string forms the part of a URL after the question mark:
https://www.mywebsite.com/?mykey=myvalue
It allows key-value pairs to be passed to a web application or database using a URL.
You can have multiple keys and values in a query string, each separated by &
, for example, mykey1=myvalue1&mykey2=myvalue2
.
Hidden values use case
This use case explains how a user might use hidden values to direct responses to individual staff members from a form.
Problem
You have a list of staff on your website, and each staff member has a Contact me button, linking to a form that collects a visitor's contact and enquiry details.
However, how will you know which staff member they wish to contact? You could create a form for each staff member - but that's a lot of unnecessary work!
Solution
Create just one form but make use of a query string key-value pair in each button's link to provide the staff member's name, for example:
https://[formlink]?staffmember=[name].
This name gets stored in the response and you'll know who needs to pick up the enquiry.
Insert the Hidden value block
Go to Content > Surveys, pages, and forms and edit or create a form.
In EasyEditor, expand the Form blocks menu on the left side.
Drag the Hidden value block onto the EasyEditor canvas.
Remember, this shows only in your reporting, so put it somewhere that makes sense, for example, the last field in your form.
Select the Hidden values block, and for Query string key, enter the query string key you want to use.
If you want the value stored against your contacts, assign it to a contact data field.
In the use case above, we would assign it to the STAFF_MEMBER data field.
Complete and select SAVE to save your form.
Publish your form, and copy the form's URL. You can also select PUBLISHED PAGE > COPY LINK.
Learn how to publish a form in Create and publish a form.Add your query string to end of the share link.
In our use case example, this relates to each staff member's Contact me button. In Joe's case, his button's URL is https://[formlink]?staffmember=Joe
.
View the hidden value
Once your survey has responses, you can see the hidden value in reporting.
To view the hidden value:
Go to Analytics > Reports, expand the MORE REPORTS drop-down menu and select Surveys, pages and forms.
Find your form and in the Form responses column, select the number to see the responses.
The hidden field is shown, along with the value supplied. The values are also included in printed reports, and exports.
Hide data field values from respondents
If you want to collect data you already hold in a data field for your contacts in a form response, but don't want these fields to display on the form, you can do this using the If you already have this data for a respondent drop-down menu when you assign a form field to a contact data field.
Learn more in Assign data fields to your form blocks.
This means that you can include, for example, an email address field, but by choosing the Hide this question option, the field doesn't show in your form, but the data is collected in your responses.
Troubleshoot form URLs and hidden values
If you have issues with your form URLs or hidden values are not working properly, consider these troubleshooting steps:
Domain issues
If your form doesn't work on a custom domain, verify if it works on a default Dotdigital domain. This can help identify whether the issue is related to domain delegation.
Query string verification
Double-check the accuracy of your query string parameters to ensure hidden fields populate correctly.Test before distribution
Always test your form with the complete URL including query strings before sending it.