Form Events With Script Execution in LeadGen Forms.

This article is about how you can execute different events using JavaScript in LeadGen Forms.

With our Tracking Events feature you can execute javascript code snippets on different form events such as form load, step changed, successful submission, etc. You can fire events like ads, alerts, prompts and more with this feature. 

Note: It is expected that the user has a fair knowledge of JavaScript. This feature only allows you to execute scripts on various form events. For tracking you can use our Google Analytics Integration.

Let’s quickly go through the steps with an example.

  1. Select the form from the form list that you want to track the events for. You’ll see a new tab “Tracking Events”.

  1.  Under the Tracking Events tab you’ll see a list of form events that you can configure.

  1. Select the event from the list that you want to configure. Click the “Edit Event JavaScript” button and add the script in the modal as shown below. Set the toggle active and hit the save button. In this example let's configure the event 'Loaded'. I have added the script for a youtube video which i want my users to see whenever the form loads.

NoteThe code snippet should be exclusive of script tags “<script> </script>”. 

  1. Embed the form on your landing page. This is how the form looks like in the live view upon loading in our example. The youtube video will load every single time the form loads up.

👆 You’re all caught up