Form Submission Tagging
decibelInsight('formSubmitted', form);
form in the above example should be replaced with the relevant HTML form element or CSS selector pointing to a form on your website, such as in the examples below:// Trigger submission of a form identified by DOM element.
decibelInsight('formSubmitted', form);
// Trigger submission of a form identified by a CSS selector. In this example, it is an ID of contact-form.
decibelInsight('formSubmitted', '#contact-form');
An example form can be seen below, which has an ID of contactform. We will use this as part of our form submission.<form action="submit.php" method="POST" id="contactform" data-di-form-track data-di-form-id="contact">
First name: <input type="text" name="field156" data-di-field-id="firstname"><br />
Last name: <input type="text" name="field135" data-di-field-id="lastname"><br />
<button type="submit" class="btn btn-success">Submit</button>
</form>
To trigger the submission of this, you would use the below and target the ID of contactform:decibelInsight('formSubmitted', '#contactform');.