> ## Documentation Index
> Fetch the complete documentation index at: https://sitegpt.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Collect leads from conversations

> Set up the lead form so the chatbot collects visitor contact details during a conversation.

Lead collection shows a lead form inside the chat. The visitor fills in the form, and SiteGPT saves the details as a lead. You choose the fields and when the form appears.

This page also covers **Pre-Chat User Details**, a separate form that shows before the conversation starts.

## Before you start

* **Plan:** any plan. See [Plans and limits](/docs/reference/plans-and-limits).
* **Role:** any team role can change lead settings. See [Team members](/docs/guides/account/team-members).
* If you use a booking tool, have your booking page URL ready.

## Turn on lead collection

<Steps>
  <Step title="Open the lead settings">
    In your chatbot's sidebar, select **Leads** > **Leads Settings**. The **Settings** tab opens.
  </Step>

  <Step title="Turn on lead collection">
    Turn on **Enable Lead Collection**.
  </Step>

  <Step title="Choose the contact fields">
    Under **Basic Contact Fields**, turn on **Name**, **Phone Number**, or both. **Email Address** is always collected. You cannot turn it off.
  </Step>

  <Step title="Choose a template">
    Under **Industry Template**, select a template for your business, or select **Custom**. See [Industry templates](#industry-templates).
  </Step>

  <Step title="Choose when the form appears">
    Under **Collection Triggers**, select one trigger. See [Choose a trigger](#choose-a-trigger).
  </Step>

  <Step title="Save">
    Select **Save Changes**.
  </Step>
</Steps>

## Choose a trigger

You can select only one trigger.

| Trigger                                    | What happens                                                                                                                                            |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **When user shows interest (Recommended)** | The AI shows the form when the visitor shows real interest, for example when they ask about pricing.                                                    |
| **When unable to answer**                  | The AI shows the form when it needs more details about the visitor's situation to give a good answer.                                                   |
| **After N messages (static form)**         | The form shows after the visitor's Nth message. Type N in the box in this option. N is a number from 1 to 20. The default is 1. The AI does not decide. |

With the two AI triggers, the AI asks for the details with the form, not in a chat message. The AI is told to show the form only one time per conversation.

The **After N messages** form does not show if the visitor already gave their details, for example in the pre-chat form.

### Add trigger keywords

When you select the **Custom** template, you can add keywords. The AI then tries to collect details when a visitor mentions one of them.

1. Under **Custom Trigger Keywords**, enter words in **Keywords (Optional)**. Separate the words with commas, for example `pricing, demo, quote`.
2. Select **Save Changes**.

Keywords are not used with the **After N messages** trigger.

## Industry templates

A template sets preset form fields and topic keywords for one type of business. The templates are:

* Dental Clinic
* HVAC Services
* Legal Services
* Real Estate
* Automotive
* Healthcare
* SaaS/Software
* E-commerce
* Consulting
* Custom (no preset fields)

When you select a template other than **Custom**, the page shows a preview of its fields. All templates except **E-commerce** include booking. For those templates you must enter a **Booking System URL**.

To change the fields of a template, select **Custom**. The current fields stay, and you can edit them.

## Add custom fields

Custom fields are available when the template is **Custom**.

<Steps>
  <Step title="Add a field">
    Under **Custom Form Fields**, select **Add Field**.
  </Step>

  <Step title="Set the label">
    In **Display Label**, enter the text that the visitor sees, for example `Budget Range`.
  </Step>

  <Step title="Set the field name">
    In **Field Name**, enter an internal name, for example `budget_range`. SiteGPT uses this name in exports and webhooks.
  </Step>

  <Step title="Choose the field type">
    In **Field Type**, select **Text**, **Email**, **Phone**, **Text Area**, or **Select Dropdown**. For **Select Dropdown**, enter each option on a new line in **Dropdown Options**.
  </Step>

  <Step title="Set the other options">
    Turn on **Required field** if the visitor must fill in the field. In **Placeholder Text**, enter a hint that shows inside the field.
  </Step>

  <Step title="Save">
    Select **Save Changes**.
  </Step>
</Steps>

<Warning>
  Do not use `message` or `reason` as a field name. These names are reserved. If you use one, SiteGPT shows an error when you save. Each field name must also be unique.
</Warning>

SiteGPT also saves the page the visitor was on as `page_url`. You do not need a field for it.

## Add a booking link

A booking link lets visitors book a time with you from the chat. The AI includes the link when it collects the lead.

* With an industry template that includes booking, enter your link in **Booking System URL**. This field is required.
* With the **Custom** template, turn on **Enable booking integration**, then enter your link in **Booking System URL**.

Select **Save Changes** when you finish.

## Hand the conversation to your team after a lead

Turn on **Auto-escalate on lead capture** to send the conversation to a human after the visitor submits the form. To set up human support, see [Set up human support](/docs/guides/human-support/set-up-human-support).

## Ask for details before the chat starts

**Pre-Chat User Details** is a separate form. It shows before the conversation starts. It works independently of AI lead collection. The **Name** and **Phone Number** toggles under **Basic Contact Fields** choose which fields it shows. You can change these toggles only while **Enable Lead Collection** is on.

1. On the **Settings** tab, go to **Pre-Chat User Details**.
2. Select one option:
   * **Required**: visitors must enter their details before they can start the conversation.
   * **Optional**: the form shows before the conversation, but visitors can skip it.
   * **Off**: no pre-chat form. The AI or an escalation can still collect details.
3. Select **Save Changes**.

## Change the text on the lead form

To change the form heading, the button text, or the confirmation message, go to **Language & Region** and edit the **Lead Form** section. See [Change the widget language and text](/docs/guides/widget/language-and-text).

<Note>
  On HIPAA workspaces, industry templates are not available. Conversations are redacted after 7 days, but lead records stay until you delete them. See [HIPAA](/docs/account/hipaa).
</Note>

## Check that it works

1. Open your chatbot on your website or in the dashboard preview.
2. Start a conversation that matches your trigger. For example, ask about pricing if you use **When user shows interest (Recommended)**.
3. Fill in the form and submit it.

The chat shows a confirmation that the details were saved. The new lead shows in **Leads** > **Leads Dashboard**. To work with your leads, see [Manage leads](/docs/guides/leads/manage-leads). To send leads to email or other tools, see [Send leads to other tools](/docs/guides/leads/send-leads-to-other-tools).
