When submitting native form data, you can exclude fields. This article will detail how to exclude fields from form submissions.
Available With:
Trial | ✓ | |
Essential | ✓ | |
Advanced | ✓ | |
Ultimate | ✓ |
Users:
Administrators | ✓ | |
Company Managers | ||
Marketing Managers | ||
Sales Managers | ||
Salespersons | ||
Jr. Salespersons |
Excluding Fields
When collecting form data, there can be reasons to exclude a field from the submission to Lead Gen & CRM. The most common reasons for this are:
- The field includes sensitive data. The field includes data, such as passwords or social security numbers, that should not be transmitted over the connection to Lead Gen & CRM.
- Fields that cause form submissions to fail. Some third-party providers add additional fields that do not need to be collected by Lead Gen & CRM, but have names or data that cause issues due to length or special characters.
To edit your native form embed code to exclude passing specific fields, do the following:
- Click Forms in the left toolbar.
- Create or open a native form.
- Copy the form's embed code.
- Add the
var hidden = [];
code snippet directly below thevar __ss_noform = __ss_noform || [];
code snippet in a text editor. - Add the
hidden.push("field_name_1");
code snippet underneath thevar hidden = [];
code snippet. - Replace
field_name_1
with the name attribute of the field to be excluded. - Repeat as necessary for each field that will be excluded.
- Add the code snippet
__ss_noform.push(['exclude', hidden]);
directly below the__ss_noform.push(['endpoint', 'xXxXxXxX-xXxX-xXxX-xXxX-xXxXxXxXxXxX']);
code snippet. - Place the edited native form script before the closing
<form>
tag or closing<body>
tag on the page where the native form lives. - Submit the form.
- Map the fields in Lead Gen & CRM.
Excluded fields will not appear on the field mappings page for your form.
Note: Constant Contact offers Professional Services to assist with custom coding.
Code Examples
The following is an example embed code before edits.
<!-- Lead Gen & CRM Native Form -->
<script type="text/javascript">
var __ss_noform = __ss_noform || [];
__ss_noform.push(['baseURI', 'https://app-xXxXxXxXxX.marketingautomation.services/webforms/receivePostback/xXxXxXxXxX/']);
__ss_noform.push(['endpoint', 'xXxXxXxX-xXxX-xXxX-xXxX-xXxXxXxXxXxX']);
</script>
<script type="text/javascript" src="https://koi-3QKH0X1U88.marketingautomation.services/client/form.js?ver=1.1.1"></script>
The following is an example embed code after edits.
<!-- Lead Gen & CRM Native Form -->
<script type="text/javascript">
var __ss_noform = __ss_noform || [];
var hidden = [];
hidden.push("field_name_1");
hidden.push("field_name_2");
hidden.push("field_name_3");
__ss_noform.push(['baseURI', 'https://app-xXxXxXxXxX.marketingautomation.services/webforms/receivePostback/xXxXxXxXxX/']);
__ss_noform.push(['endpoint', 'xXxXxXxX-xXxX-xXxX-xXxX-xXxXxXxXxXxX']);
__ss_noform.push(['exclude', hidden]);
</script>
<script type="text/javascript" src="https://koi-3QKH0X1U88.marketingautomation.services/client/form.js?ver=1.1.1"></script>