SublimDocs

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 like email, mail, contact_email;
  • or a phone field: type="tel", or a name or id like phone, 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 a POST request 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

PropertyExampleDescription
form_idcontact-formThe form's id, else its name, else a generated ID. Fetch-only forms get spa_form.
form_url/contactPath of the page the form was submitted on.
form_action/api/contactWhere the form posts to.
form_methodpostHTTP method.
field_count / total_fields4 / 5Fields filled in / fields in the form.
field_namesname,email,phone,messageField names only, never their values. Sensitive fields are left out.
field_typestext,email,tel,textareaField types.
form_classcontact form-lgThe form's CSS classes, if any.
data_*data_formType: quoteEvery 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:

JavaScript
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

JavaScript
sublim.o = { projectId: 'YOUR_PROJECT_ID', trackForms: false };