Skip to main content
Forms are often the most important conversion point of a website. Whether newsletter, contact request, or lead gen – you want to know how often they are filled out. The most reliable way to measure a successful submission is redirection to a separate confirmation page (e.g., /thank-you or /success). Why is this better?
  • You only measure real submissions (no validation errors).
  • There are no technical issues with page reloading.
1

Setup Redirection

Configure your form plugin or CMS so that the user is redirected to /thank-you after submission.
2

Trigger Event

Insert a small script on this thank you page that fires upon loading.
<script>
    // Waits until page is loaded
    window.addEventListener('load', function() {
    if (window.bchic) {
    bchic('track', 'form_submit_success', { form_id: 'contact_page' });
}
});
</script>

Method 2: HTML Attributes (The Fast Way)

If you don’t have a thank you page or the form is sent via AJAX (without reloading), you can tag the submit element directly. Simply add the data-bchic-event attribute to your submit button.
<form action="/submit" method="POST">
  <input type="email" name="email" placeholder="Your Email" />

  <!-- Tracking sits on the button -->
  <button type="submit"
          data-bchic-event="newsletter_signup_click">
    Sign Up
  </button>
</form>
Attention: This tracks the click on the button. It also counts if the user clicks the button but the form is not sent due to missing data (e.g., invalid email).

Method 3: JavaScript (Precise Control)

For full control (e.g., only track if validation was successful), use JavaScript.
const form = document.getElementById('my-form');

form.addEventListener('submit', (e) => {
  // 1. Check validation here optionally

  // 2. Send tracking
  bchic('track', 'contact_form_submit', {
      category: 'sales_request' // Example Payload
  });

  // Form is processed normally afterwards
});

Form Data in Payload? (Privacy!)

You might want to know what was selected in the form (e.g., the subject of the request). This is possible, but you must be extremely careful.
// Track selection in a dropdown
const subject = document.getElementById('subject_select').value;

bchic('track', 'form_submit', {
topic: subject // e.g. "Support" or "Sales"
});
Rule: Never send data that could identify a user (email, name, phone, address). Limit yourself to generic selection fields (category, department, product interest).