Articles in this section
Adding Additional Hidden Fields to a Webform
Table of Contents
Introduction
You can add additional hidden fields to a webform, to use it across multiple channels.
|
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:
- Log in to your CRM account.
- Click the User Menu on the top right corner of the CRM screen.
- Select Settings.
- Go to the Automation section.
- Select Webforms.
- Click +Add Webform.
- Fill out all the mandatory information.
- Go to the Additional Hidden Fields block.
- Click inside the Click to select fields space.
- Add fields.
- For instance, if you consider the example above, you can add the Lead Source field.
- 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.
- 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.
- Click Save.
|
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:
- Log in to your CRM account.
- Click the User Menu on the top right corner of the CRM screen.
- Select Settings.
- Go to the Automation section.
- Click Webforms.
- Click a webform where additional hidden fields are already set up.
- Scroll down to the Additional Hidden Fields block.
- Click the View Code button shown on the right.
- Click Copy to clipboard. The script gets copied.
- Paste it in a text editor file and save it with .js extension.
- 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.