In this article, we're going to go over how to track ClickFunnels form submissions in Funnelytics. 

Do not use this method to track purchases. Only lead generation forms.

1. Add the listener in ClickFunnels

The first step is to add a bit of code to <body> of the page that has the form. 

a. Go to the step where your lead generation form is located. 

b. Click on the "EDIT PAGE" button of the page.

c. Go to 'SETTINGS' and then chose "TRACKING CODE"

c. In the tracking code settings, add the following code to the

<script>
jQuery(function($){
$('[href^="#submit-form"]').click(function(){
    var firstName = $('[name~="first_name"]').val();
    var userEmail = $('[name~="email"]').val();
    if ( firstName !== "" && userEmail !== "") {
        console.log('The Form Was Submitted');
        window.funnelytics.events.trigger("complete-form", {
            name: firstName,
            email: userEmail,
            form: "optinPage",
        }, function() {
            // continue with process..
        });
      } else {
        console.log('Nope, the form was not validated');
      }
  })
});
</script>

d. Save the page

2. Setup the action in Funnelytics

The code provided above will trigger a Funnelytics event/action with the name of "complete-form" and it has an attribute of "form" with a value of "optinPage".

a. Map a complete form action from the actions folder onto the canvas and connect the page to it.

b. Go to the SETTINGS of the action. Under the TRACKING tab, add the event name and attribute to the fields.

3. Verify and Troubleshoot

To verify that your form submit action is working as expected, visit the page with form. Then, open up developer tools and go to the 'console'

With the console open, complete the form on the page. If it worked, you should see a message appear in the console "The form was submitted"

If the message says "Nope, the form was not validated" it means that the name and email fields could not be detected to have a value.

Alternatively, you can follow these steps:
http://help.funnelytics.io/en/articles/3751144-how-to-verify-actions-are-working-properly

If you have any questions or need further clarification about tracking form submissions in ClickFunnels, remember to reach out to our support team anytime by clicking the support icon in the bottom-right corner of your dashboard, we are always ready to assist you!

Did this answer your question?