Skip to main content
Version: 8.3

Extend landing page form submission with custom fields and actions

note

This functionality is available for Creatio 8.3.3 and later.

When visitors submit a landing page form, Creatio collects only the data they fill out. If you need to receive additional data in Creatio beyond what visitors fill out or run custom logic before submission, you can extend the form submission behavior via the Add script tab on a landing page in Creatio. For example, you can pass a campaign ID or run a validation check.

Before you start, make sure the following parameters are configured in the landing page form's Block options in Landing Page Designer:

  • the Block identifier toggle is enabled
  • the ID field includes an ID that connects the script to the form. Use a unique value without spaces. For example: "Demo_Form." If the ID contains multiple words, use an underscore instead of a space.

Add custom fields to form submission

Use this to pass additional data to Creatio along with the form submission. Typical examples include a campaign ID, lead source, partner name, or any internal tracking value.

To add custom fields to a form submission:

  1. Open the Lead Generation app and go to the Landing pages section.

  2. Open the landing page you want to customize.

  3. Go to the Add script tab.

  4. Click Add script. This opens the Add script window.

  5. Fill out the script parameters.

    Parameter

    Description

    Name

    An arbitrary script name. For example, "Add custom fields script."

    Position

    Position in the page HTML. The position controls when the script loads and how it interacts with the rest of the page content. For this script, select "Body bottom." This ensures the script runs after all page content is loaded.

    Script

    <script type="text/javascript">
    crtLanding.setFormConfig('ID_OF_SOME_LANDING_PAGE_FORM', {
    onSubmit: (formData) => {
    formData.append('SomeCustomField', 'SomeCustomFieldValue');
    }
    });
    </script>

    Where:

    • ID_OF_SOME_LANDING_PAGE_FORM is the ID from the Block options of the landing page form in Landing Page Designer.
    • SomeCustomField is the field code.
    • SomeCustomFieldValue is the field value.
  6. Click Add script.

  7. Click Publish to apply the changes.

As a result:

  • The custom field will be appended to form data on every submission.
  • The field value will be sent to Creatio together with the standard form data.

Run custom actions before form submission

Use this to run additional logic before form data is sent. For example, extra validation, tracking events, or logging.

To run custom actions before form submission:

  1. Open the Lead Generation app and go to the Landing pages section.

  2. Open the landing page you want to customize.

  3. Go to the Add script tab.

  4. Click Add script. This opens the Add script window.

  5. Fill out the script parameters.

    Parameter

    Description

    Name

    An arbitrary script name. For example, "Track corporate emails script."

    Position

    Position in the page HTML. The position controls when the script loads and how it interacts with the rest of the page content. For this script, select "Body bottom." This ensures the script runs after all page content is loaded.

    Script

    <script type="text/javascript">
    crtLanding.setFormConfig('ID_OF_SOME_LANDING_PAGE_FORM', {
    onSubmit: (formData) => {
    /* Add your custom logic here, for example, validation or tracking. */
    }
    });
    </script>

    Where:

    • ID_OF_SOME_LANDING_PAGE_FORM is the ID from the Block options of the landing page form in Landing Page Designer.
    • onSubmit is the function that runs when the visitor submits the form, before the form data is sent.
  6. Click Add script.

  7. Click Publish to apply the changes.

As a result, the custom logic will run every time the visitor clicks the Submit button, before the form data is sent.


See also

Landing pages (user documentation)