Lead Gen & CRM
How can we help you?
Search our help articles, video tutorials, and quickstart guides

You've got this. You've got us. Search our Knowledge Base to quickly find answers to your questions.

Passing Hidden Fields Through Lead Gen & CRM Forms

Article: 000050208
Updated: June 5, 2026

Pass hidden field values into a custom field in Lead Gen & CRM when a form is filled out

Lead Gen & CRM allows you to create dynamic forms that can be placed on your site wherever you choose. Occasionally, you may need to pass hidden field values into a custom field within Lead Gen & CRM.


Article Contents

 
Users:
Administrators 
Company Managers 
Marketing Managers 
Sales Managers  
Salespersons  
Jr. Salespersons  


Hidden Field Differences 

When you pass hidden field values, the value can vary based on which page of your site the form is submitted on. For example, if you use the same Contact Us form across multiple pages of your site, you can pass a different value across each page. 

Alternatively, if you create a hidden field in the Form Builder, the hidden value will be the same regardless of where an individual fills out the form. If you have a script that grabs the browser URL and places it in a hidden field, you can log the location in the contact record. 

This value would end up being unique, per placement of the Lead Gen & CRM form script. This would be impossible to do using the hidden field option in the Form Builder. The hidden field option in the Form Builder is still valuable, but passing hidden fields provides a bit more flexibility for the type of information you can fetch. 

Note: Constant Contact offers Professional Services to assist with custom coding.


Obtaining Hidden Field Information

Form embed codes can be modified. For system fields, you can pass your own values into these fields. For custom fields, instead of using the field name, use the field's system ID. To obtain a fieldID value, complete these steps from Settings in the left toolbar: 

 

  1. Click Custom Fields, located under Features in the left panel.
  2. Locate the custom field to include in the form, click the three-dots menu to the right of the custom field, and click the Copy fieldID to Clipboard.

    Copy fieldID to Clipboard button in the expanded three dots menu under the Custom Fields section


Adding Hidden Fields to Form Embed Codes

Once the fieldID value has been obtained, it must be inserted into a form. To do so, the form's embed code will need to be modified. To edit a form embed code to add a hidden field, create or edit a form:

 

  1. Click  12more.png  Actions > Embed Code.

    Embed Code section under the three dots menu under the Actions column of the form list   
  2. Locate the ss_form.hidden = {'field_id': 'value'}; line of code and remove the two slashes // before ss_form.hidden.

    // ss_form.hidden text in code text box in the popup window 
  3. Paste the custom field ID in place of id in field_id. For example, change field_id to field_3737631747. In place of value, enter the value you want to be tracked upon page visit. 
     
    Note: The value can be a static value in quotes, a JavaScript variable, or JavaScript code that returns a value. These values are collected when the form is displayed, and any changes to them after the form is rendered will not be recognized.

  4. Click Close.

    Modified ss_form.hidden code to include custom field information  

As an example, if the custom field is stored in a JavaScript variable called prodName, then the edited line of code would appear as follows:

ss_form.hidden = {'field_96971777': prodName};

This procedure assumes that you are editing the embed code for the first time.

If you cannot find {'field_id': 'value'};, search instead for ss_form.hidden = and modify the respective content within the sets of single quotations.

Important: Fields being passed as hidden fields using this method should not be added to the form in the form editor. Passing these fields as hidden fields creates blank space at the bottom of the form.


Frequently Asked Questions

Q: How do I pass multiple values?
A: Separate the values with commas.

{'field_96971777': prodName, 'field_01010101': anotherValue}


Q: How do I pass a static string using the hidden field?
A: Include the string within single quotation marks.

'12345'


Q: How do I pass a referrer field?
A: You will need to use ref_ instead of field_.

ss_form.hidden = {'ref_96971777': prodName};

 


Did this article answer your question?


Constant Contact Logo

Copyright © 2026 · All Rights Reserved · Constant Contact · Privacy Center