সহায়তার সাথে যোগাযোগ

আমরা ইমেইলে উত্তর দিই, সাধারণত দুই দিনের মধ্যে।

অপব্যবহার ঠেকাতে Google reCAPTCHA এই জমাটি যাচাই করে; এতে ডেটা Google-এ পাঠানো হয়। এই ফর্মটি খোলা হলেই কেবল স্ক্রিপ্টটি লোড হয়।

← সব পোস্ট

Measure form success instead of button clicks

Clicking a submit button, submitting a form and completing its processing are different events. A validation error, failed request or server rejection can follow a click. Stats4U provides automatic contact categories, marked submissions and explicit form-success events; the choice determines what the report actually means.

123
  1. Submission
  2. Application result
  3. Success event

Enable only the needed measurements

  1. Open the owned counter through My counters, then open Dashboard and tools and Contact actions.
  2. In Measurement settings, enable Automatically count phone, email and download clicks for those click categories, or Count marked form submissions and confirmed form successes for marked submissions and confirmed successes.
  3. Choose Save and verify that the website uses the generated JavaScript integration.

Automatic contact categories use action names such as contact-email, contact-phone and download. They describe a click, not a delivered email, answered call or completed download. The event does not send the address, telephone number or form-field contents.

Mark a form submission

Add a stable, non-personal form name to the form element. The name should describe its purpose rather than identify a visitor. This example marks a contact form:

<form data-s4u-form="contact">
  <!-- Existing form controls and submission handling -->
</form>

The marker produces form-submitted-contact when the browser submits the form. It does not prove that the server accepted or processed it. Keep the form’s existing validation and processing code; adding a measurement marker does not implement form handling.

Confirm success at the actual success point

For a custom form, call the success function only after the application has confirmed successful processing. An HTTP response arriving, a button click or a fetch promise resolving is insufficient on its own: the application must interpret its own server response and error state.

if (window.s4u && typeof window.s4u.formSuccess === 'function') {
  window.s4u.formSuccess('contact');
}

This call produces form-success-contact when form measurement is enabled and the tracker is available. Put it in the existing confirmed-success branch, not before the request and not in an unconditional completion handler. Contact Form 7 can use its supported successful-mail event integration; a generic form requires an explicit application success signal.

Check both success and failure

  1. On an owned test installation, try a valid submission and a submission that the application rejects. Only the confirmed success should send the success event.
  2. Use Measurement debugger to check whether the expected event category and name would be accepted, without counting a real event.
  3. Compare the resulting event names in the report. A submission count larger than the success count can be a useful signal, but is not proof of one specific error.

The debugger checks eligibility, not successful delivery of a real form. Inspect the application response and normal tracker requests separately. Keep names and form contents out of event labels and diagnostic properties.

Next step

Check the integration guide before adding the success call to the application.

Open the installation guide
বিজ্ঞাপন