Forms & leads
Successful submissions of lead forms are tracked as form_submit events. They are the leads of the Leads page. Field values are never sent.
What counts as a lead form
A form is tracked when it contains:
- an email field:
type="email", or a name or id likeemail,mail,contact_email; - or a phone field:
type="tel", or a name or id likephone,tel,mobile,whatsapp.
A form is never tracked if it contains a sensitive field: a password, or a name or id like token, api_key, credit_card, cvv, account_number, ssn, passport, pin… Login, sign-up-with-password and payment forms are therefore ignored.
When it fires
- Classic forms: on
submit, once the browser's validation has passed. - JavaScript forms (
fetch/XMLHttpRequest): when aPOSTrequest answers with a 2xx status. That covers React, Vue and other forms that never reload the page. - Forms added to the page later, in modals or after navigation, are picked up automatically.
- The same form submitted twice within one second counts once.
Properties sent
| Property | Example | Description |
|---|---|---|
form_id | contact-form | The form's id, else its name, else a generated ID. Fetch-only forms get spa_form. |
form_url | /contact | Path of the page the form was submitted on. |
form_action | /api/contact | Where the form posts to. |
form_method | post | HTTP method. |
field_count / total_fields | 4 / 5 | Fields filled in / fields in the form. |
field_names | name,email,phone,message | Field names only, never their values. Sensitive fields are left out. |
field_types | text,email,tel,textarea | Field types. |
form_class | contact form-lg | The form's CSS classes, if any. |
data_* | data_formType: quote | Every data-* attribute of the <form>. |
Name your forms
Give each form an id (<form id="quote-request">), or a data-* attribute describing it (data-form-type="quote"). They show up in the Leads by form breakdown and make reports much easier to read.
Leads look wrong?
Some forms can't be detected reliably: multi-step forms, forms posting to a third party, booking widgets in an iframe. In that case, send your own event once a lead is confirmed:
sublim.trackEvent('lead', { props: { form: 'appointment' } });
Then, on the Leads page of the dashboard, click Leads look wrong? and switch the leads source to that event. It replaces form detection for all lead reports in one click, and you can switch back at any time. The dialog also gives you a ready-made prompt for your developer or AI code editor, built from the forms already detected on your site.
Turning it off
sublim.o = { projectId: 'YOUR_PROJECT_ID', trackForms: false };