Advanced Settings for Embeddable Lead Capture Forms (Reference)

Article Details

Advanced Settings for Embeddable Lead Capture Forms

It's possible to add the code anywhere in your HTML document and provide a target to add the lead form to. This way, you don't have to paste the code exactly where you want the form displayed on the page. Here's an example HTML document that contains examples of explicit targeting: https://storage.googleapis.com/gingr-embeddable/index.html.

<script>
window.GingrForms.createForm({
form_name: 'lead_form',
subdomain: '{YOUR_GINGR_SUBDOMAIN}',
target: "div#exampleTargetContainer",
})
</script>

 

As you can see, we've added a "target" property to the options object which contains a CSS selector to a DOM element, in this example a div with ID exampleTargetContainer.

It's also possible to add a form submission callback. This callback allows you to run custom JavaScript code after a form has been submitted successfully. This can be especially useful for advertising conversion tracking.

<script>
window.GingrForms.createForm({
submit_callback: function() {
alert('Form submission completed successfully!')
},
form_name: 'lead_form',
subdomain: '{YOUR_GINGR_SUBDOMAIN}',
target: "#exampleTargetContainer",
})
</script>

 

As you can see, we've added a "submit_callback" property to the options object which ontains an anonymous function that alert() the user that the form was submitted successfully. You can replace "alert('Form submission completed successfully!')" with your desired code.

 

Related Resources

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.