Advanced Settings for Embeddable Lead Capture Forms (Reference)

Article Details

Summary

You can add the lead form code anywhere in your HTML document and tell it where to show the form. You can also run your own JavaScript after someone submits a form.

What This Does

Target a Place on the Page

With a target, you do not need to paste the code exactly where you want the form. See this example HTML document with 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>

The target property holds a CSS selector for an element on your page. In this example, it is a div with the ID exampleTargetContainer.

Add a Form Submission Callback

A callback runs your own JavaScript after a form is submitted. This is 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>

The submit_callback property holds a function. In this example, it shows an alert that the form was submitted. Replace alert('Form submission completed successfully!') with your own code.

Related Articles

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.