# Collect leads

> Save the name, email, and phone number of visitors who want your team to get in touch.

Collect leads saves the contact details of people who want to hear from you: someone asking for a demo, a quote, a call back, or a fitting appointment. Your agent can show a short form in the chat, or pick up the details from the conversation.

**Where to find it:** open your agent, go to **Build → Actions**, and select **Collect leads**.

![A chat where the agent offers a Talk to our team form after a demo request](https://hourzero.dev/marketing/app/widget-lead-form-light.webp "A visitor asks for a demo, and the agent offers a short form: name, work email, and an optional company.")

## How it works

1. **Visitor asks**: "Can I get a demo for my team?"
2. **Agent collects**: It shows a form, or asks in the chat.
3. **Lead saved**: The details appear on Activity → Leads.
4. **You follow up**: Your team gets in touch with the person.

Saving a lead records the request. It doesn't contact the person for you, so make sure someone on your team checks **Activity → Leads**, or send new leads to another tool with a [webhook](https://hourzero.dev/docs/integrations/webhooks).

## Choose Form or Auto

Under **Collection method**, pick how the details are gathered.

| Method | What the visitor sees | Best for |
| --- | --- | --- |
| **Form** | A short form in the chat that they fill in and submit | Your website chat, where you want clear, typed-in details |
| **Auto** | No form. The agent asks for what it needs in the conversation | Messaging apps like WhatsApp, and natural, chatty flows |

With **Auto**, the agent only asks for required details it doesn't have yet, and saves the lead as soon as it has them. If the visitor already said "I'm Nina from Brightlane, nina@brightlane.io", the agent won't ask again.

> [!NOTE]
> Forms only appear in your website chat (Chat Bubble, Center Stage, and Chat Iframe). On WhatsApp, Messenger, Instagram, Slack, Discord, and Telegram, use **Auto**, or turn the action off for those channels.

## Set up a lead form

This example creates the **Talk to our team** form shown above.

1. Open **Build → Actions** and select **Collect leads**.
2. In **Action name**, enter `Demo request`.
3. In **When should the agent use it?**, enter:

   ```text
   Use when a visitor asks for a demo, a quote, or for someone to contact
   them. Answer their product question first. Don't collect details from
   people who are only browsing.
   ```

4. Under **Collection method**, choose **Form**.
5. In the **Form builder**, select the title "How can we reach you?" and type `Talk to our team`. To change or remove the line under it, edit the description or select its trash icon.
6. The form starts with **Name**, **Email**, and an optional **Phone** field. Select the label **Email** and type `Work email`.
7. Select the **Phone** field, then select **Remove** in its **Field settings**.
8. Select **Add field**. Name the new field `Company`, open its settings, and turn off **Required field**. Optional fields show "(optional)" next to their label.
9. Select the button at the bottom of the form ("Send details") to change its text, for example `Send`.
10. Under **After submission**, edit the message the visitor sees once they submit, for example `Thanks! Someone from our team will email you within one business day.`
11. Select **Create action**.

![The Collect leads setup window with the Form collection method and the form builder](https://hourzero.dev/docs/ai-agent-management-actions-collect-leads.webp "The form builder: edit the form directly, and select a field to open its settings.")

### Field settings

Select any field to open its **Field settings**:

- **Field type:** **Short text**, **Long text**, **Email**, **Phone**, **Number**, **Yes / no**, or **Select**.
- **Field key:** a short code created from the label. It's used in exports and webhooks, so you don't need to change it.
- **Contact field:** links the field to the contact's **Name**, **Email**, or **Phone**. See [Link fields to the contact](#link-fields-to-the-contact).
- **Options:** for **Select** fields. Enter the choices separated by commas, for example `1-10, 11-50, 51+`.
- **Required field:** when on, the visitor can't submit the form without filling it in.

Select **Add helper text** under a field to add a short hint, like "We'll only use this to arrange your demo." A form can have up to 20 fields.

> [!TIP]
> Ask for as little as you can. A form with two or three fields gets filled in far more often than one with eight. You can always ask for more on the follow-up call.

## Set up Auto collection

1. Under **Collection method**, choose **Auto**.
2. In the **Fields** section, set up each detail the agent should collect: **Label**, **Type**, **Contact field**, **Description**, and **Required**. The **Description** helps the agent understand what belongs in the field, for example "The visitor's work email, not a personal address."
3. Select **Add field** for more details.
4. Under **Confirmation**, write the **Success message**. The agent uses it to confirm what was saved.
5. Select **Create action** (or **Save changes**).

## Link fields to the contact

When a field's **Contact field** is set to **Name**, **Email**, or **Phone**, a submitted lead fills in that detail on the visitor's [contact](https://hourzero.dev/docs/ai-agent-management/contacts) record. That way you know that the visitor who asked for a demo is Nina Alvarez from Brightlane.

- New lead forms link **Name**, **Email**, and **Phone** for you.
- Only link a field that really is that detail. Don't link a "Company phone" field to the contact's **Phone**.
- Fields set to **Do not map** are still saved with the lead. They just don't change the contact.
- Contacts are only updated from live channels. Leads you submit while testing in the Playground don't change any contact.

## See and export your leads

Every saved lead appears on **Activity → Leads**, with the action, the person, the collected values, the channel, and when it was submitted.

![The Leads page with leads from Chat Bubble, WhatsApp, Slack, and Instagram](https://hourzero.dev/marketing/app/leads-light.webp "Activity → Leads: search, filter by action, channel, or date, and export to CSV.")

From there you can:

- Search across all collected values.
- Filter by action, channel (including **Playground** for your tests), and date range.
- Sort by **Newest first** or oldest first.
- Select the eye icon on a row to see every value, the contact details, and the conversation it came from.
- Select **Export CSV**, then **Export all** or **Export matched entries** to download a spreadsheet.

For more on these pages, see [Leads and collected data](https://hourzero.dev/docs/ai-agent-management/submissions). To send each new lead to your CRM or another tool automatically, set up a [webhook](https://hourzero.dev/docs/integrations/webhooks) for the `lead.created` event.

## Test it

1. In **Playground**, check that the action is switched on for your channel in the **Capabilities** tab, and select **Save draft**.
2. Ask "Can I get a demo?" The form should appear, or with **Auto**, the agent should ask for your details.
3. Fill it in and submit. Check that the success message makes sense.
4. Ask a general question, like "What's your return policy?" The agent should answer without asking for your details.
5. Open **Activity → Leads**, filter by **Playground**, and check the saved lead.
6. Publish the channel when you're happy.

## Common questions

### Can the visitor say no?

Yes. Every form has a **Cancel** button next to the submit button. If the visitor cancels, nothing is saved.

### Does the agent promise that someone will call?

Not unless you say so. By default the agent only confirms that the details were saved. If your team really does follow up within a set time, put that in the success message.

### Why don't I see the form on WhatsApp?

Messaging apps only receive text. Switch the action to **Auto**, or create a second Collect leads action in **Auto** mode and turn it on only for your messaging channels.

## Next steps

- [Leads and collected data](https://hourzero.dev/docs/ai-agent-management/submissions): Find, filter, and export everything your agent saved.
- [Contacts](https://hourzero.dev/docs/ai-agent-management/contacts): See the people behind each lead.
- [Webhooks](https://hourzero.dev/docs/integrations/webhooks): Send new leads to your CRM automatically.
- [Collect data](https://hourzero.dev/docs/ai-agent-management/actions/collect-data): Collect details that aren't contact information.
