For AI agents: the complete documentation index is available at https://docs.clickmax.io/en/llms.txt, the full documentation bundle is available at https://docs.clickmax.io/en/llms-full.txt, and this page is available as Markdown at https://docs.clickmax.io/en/reference/browser-sdk/forms/index.md.
  • English
  • Simple forms

    Use this page when you want to get a Clickmax form live with the least effort possible.

    Before you start

    You need to:

    • create an external page in Clickmax
    • add that page to your funnel
    • install the Browser SDK loader in the page's <head>

    After that, the simplest way to capture leads is to mark an existing form with data-cx-ingest-form.

    Minimal example

    <form
      data-cx-ingest-form
      data-cx-success-message="Sent successfully!">
      <input data-cx-field="name" placeholder="Your name" />
      <input data-cx-field="email" placeholder="Your email" />
      <input data-cx-field="telephone" placeholder="Your phone number" />
      <button type="submit">Send</button>
    </form>

    What that example already does

    • collects name, email and telephone
    • sends the data to Clickmax
    • includes the page's UTMs when there are any
    • shows a success message
    • lets Clickmax follow that submission through the funnel

    For a simple form, use these fields:

    • name
    • email
    • telephone
    • website as a honeypot

    Example:

    <form
      data-cx-ingest-form
      data-cx-success-message="Sent successfully!">
      <input data-cx-field="name" placeholder="Your name" />
      <input data-cx-field="email" placeholder="Your email" />
      <input data-cx-field="telephone" placeholder="Your phone number" />
      <input type="text" data-cx-field="website" hidden />
      <button type="submit">Send</button>
    </form>

    Custom fields

    Beyond the standard fields (name, email, telephone), you can send CRM custom fields straight from the form: just mark the input with data-cx-field using the field's key — the id, the internal name (fieldName) or the label (displayName) of the field, resolved in that order.

    <form
      data-cx-ingest-form
      data-cx-success-message="Sent successfully!">
      <input data-cx-field="name" placeholder="Your name" />
      <input data-cx-field="email" placeholder="Your email" />
      <input data-cx-field="telephone" placeholder="Your phone number" />
    
      <!-- custom fields: the key is the field's id, fieldName or label -->
      <input data-cx-field="empresa" placeholder="Company" />
      <select data-cx-field="faixa_salarial">
        <option value="">Select…</option>
        <option value="ate-3000">Up to R$ 3,000</option>
        <option value="acima-3000">Over R$ 3,000</option>
      </select>
    
      <button type="submit">Send</button>
    </form>

    Any data-cx-field that is not a standard lead field is sent as a custom field — the SDK groups those values automatically.

    Rules:

    • The custom field has to exist already in the CRM. Keys that do not match a field are silently ignored — this endpoint does not create fields.
    • Matching is case-insensitive for fieldName and displayName.

    The same behaviour applies via JavaScript with cxs('lead', { customFields }). See Create a lead via JavaScript.

    When to use this approach

    Use form[data-cx-ingest-form] when:

    • you already have the form's HTML
    • you want to keep control of the layout
    • you want the simplest integration possible

    Without an HTML form

    If the submission is handled by your own JavaScript (a React application or a multi-step funnel, for example), you can create the lead directly with cxs('lead', ...). See Create a lead via JavaScript.