Home  >   Articles   >  Adding Additional Hidden Fields to a Webform
Articles in this section

Adding Additional Hidden Fields to a Webform

Learn how you can use your webform across multiple channels by setting up additional hidden fields.
25 May, 2021 - Updated 2 years ago
Table of Contents


You can add additional hidden fields to a webform, to use it across multiple channels. 


Why Additional Hidden Fields

Previously in Webforms, the hidden field values were static. You could set up only one override value for one hidden field. This value could not be changed.


In contrast, Additional Hidden Field values can be dynamic. You can map a field to a URL parameter to capture different values for it. You can also set up override values that will be used when the parameter value is empty.


Tip! If you are learning about Vtiger webforms for the first time, make sure you read this article first. 


Let’s understand this better with the help of an example.


Assume you share a sign-up webform link with your leads through multiple channels such as email campaigns and Facebook lead ads.


When a lead signs up through the webform, you would like to know whether they came from email campaigns or Facebook ads. To get accurate information on the lead’s source, you can use these additional hidden fields. 

Configuring Additional Hidden Fields

In Webforms, you can specify the parameters in the URL that must capture the information you need and store it in the CRM fields you want.

Wondering how this happens?


Vtiger CRM has an added block called Additional Hidden Fields on the Webforms Settings page. Under this block, you can do the following:

  • Add a field where the information must be stored
  • Specify URL parameter that will capture the information
  • Mention the override value for each field in case the URL parameter returns an empty value

Let us now learn how to achieve the above-said goals.


Follow these steps to add additional hidden fields to a webform:

  1. Log in to your CRM account.
  2. Click the User Menu on the top right corner of the CRM screen.
  3. Select Settings.
  4. Go to the Automation section.
  5. Select Webforms.
  6. Click +Add Webform.
  7. Fill out all the mandatory information.
  8. Go to the Additional Hidden Fields block.
  9. Click inside the Click to select fields space.
  10. Add fields. 
    • For instance, if you consider the example above, you can add the Lead Source field.
  11. Specify the URL Parameter for the field. This parameter will appear in the URL of the webpages.
    • For example, source. So, the Lead Source field is mapped to the URL parameter source
  12. Enter an Override Value
    • Override values are considered if URL parameters have no value. In the example, if source has no value, then the override value you specify is used.
  13. Click Save.


  • You can add as many additional hidden fields as you like.
  • In the case of picklist fields, if the URL parameter values are not a part of the picklist, then the override value is used. 

Working of Additional Hidden Fields

Let’s consider the same example as mentioned earlier. 


Consider you receive 30 new leads after your webform is live. Fifteen of them sign up through the email campaign you sent, and the other fifteen come in through Facebook lead ads. Thus, there are two Lead Sources - Email Campaign and Facebook.


Every time a lead opens your campaign, the URL parameter source is assigned the value emailcampaign in the backend in the first case. Similarly, source=facebook in the second case.


So, you get clarity on which channels are generating the most number of leads.


We’re not done yet…


What if you want your leads to traverse through multiple web pages before landing on the sign-up webform? You can still get the source where the lead came from.


To handle such scenarios, you must embed the hidden fields’ script available in Vtiger CRM into your website code. 


Follow these steps to copy the script and embed it into your website code:

  1. Log in to your CRM account.
  2. Click the User Menu on the top right corner of the CRM screen.
  3. Select Settings.
  4. Go to the Automation section.
  5. Click Webforms. 
  6. Click a  webform where additional hidden fields are already set up.
  7. Scroll down to the Additional Hidden Fields block.
  8. Click the View Code button shown on the right. 
  9. Click Copy to clipboard. The script gets copied.
  10. Paste it in a text editor file and save it with .js extension.
  11. Copy the file to all your website pages.

The script reads the URL parameters on every page load and stores them in the client’s local storage (in any browser).


When the lead finally lands on the sign-up webform and submits it, the URL parameter value is stored in the CRM field.

Points to Remember 

URL parameters

  • A URL parameter can only have English letters, numbers, and underscore.
  • Parameter names given in Additional Hidden Fields must be different from one another.

Hidden fields

  • Email and SMS opt-in fields from Leads and Contacts modules cannot be used as hidden fields. 
  • Owner, Owner Group, and Co owner fields cannot be used as hidden fields.
  • Boolean fields or fields such as checkboxes and radio buttons should have the incoming values On or Off in the URL, translating to a Yes or a No.
  • A field can be either under Webform Fields or in Additional Hidden Fields, not both.

Picklist fields

  • If you add a picklist field as a hidden field, and the URL parameter has a value that is not present in the picklist, then the hidden field remains empty if no override value is specified.
  • For example, consider Lead Source is the hidden field and the URL parameter source=Campaign. If Campaign is not a part of the Lead Source picklist, then the Lead Source field in the lead record remains empty if no override value is specified. 

Was this article helpful?
2  out of  2  found this helpful.
Comments 0
Be the first to comment
© Copyright 2023 Vtiger. All rights reserved.