Skip to content
QwryAI
Documentation
Pages

AI Agent Management

Collect leads with your AI agent

Capture a visitor's contact details as a lead, with a form in the chat or in the conversation

The Collect leads Action captures a visitor's name, email, phone number and other details as a lead during a conversation with your QwryAI agent. It's for teams that want to turn website and messaging visitors into contactable leads and send them to a webhook or an inbox. The agent can show a lead form in the chat, or ask for the details in the conversation.

Each agent has one Collect leads Action, so there's no Action name field. To collect several different sets of details on one agent, use Collect data, which you can add more than once.

Best for: turning an interested visitor into a contactable lead before they leave, and sending that lead straight to your team.

Common use cases:

  • Capturing details when a visitor asks for a quote or a demo
  • Following up with someone whose question needs a person
  • Qualifying interest with custom fields like company name or order size
  • Seeing which campaign each lead came from, with UTM hidden fields
Create Action › Collect leads.

How to create the Action

  1. Open Actions

    In your QwryAI dashboard, select your agent and click Build › Actions in the sidebar.

  2. Create the Action

    Click Create Action, then the Collect leads card ("Collect leads by capturing user details"), then Start customizing.

    The Collect leads dialog.
  3. Configure General

    When to use: when the agent should collect a lead. You can also add other instructions, such as Show only the form without listing its fields. The Preview beside the editor helps you spot what to change.

    Describe when to collect a lead.

To run the Action only as a Procedure step, turn on Only use in Procedures. When to use is then hidden. Click Continue.

Continue saves General.
  1. Define your fields

    In Fields, choose how the agent collects details and which fields it asks for. See Fields.

  2. Write your messages

    With Collect from a form, write the Success Message and Dismiss Message. See Messages.

  3. Set your destinations

    In Destinations, choose where leads are sent, or click Skip. See Destinations.

  4. Choose Channels

    Collect leads works on every channel except phone. Turn it on or off for each configured channel. See Channels.

  5. Enable and test

    Click Enable, then try the Action in the Preview: the Live tab is a test chat, and Form, Submitted and Dismissed show each state of the form.

Fields

In Fields, you first choose how the agent collects the lead's details. This applies to the Chat bubble and Help page; other channels, like WhatsApp and Instagram, always collect details conversationally.

ModeWhat it does
Collect from a formVisitors fill out fields in a widget. Up to three fields: Name, Email and Phone.
Collect conversationallyThe agent gathers the details in the conversation. Supports custom fields.
Fields: what the lead form asks for.

Form mode

Turn each of the three fields on or off with its switch. Each field has a Label and a Placeholder you can change, and a Required box.

Turn on the fields the form shows; make Email required.

Conversational mode

The fields table has two parts:

  • Identity fields: Name, Email and Phone. Turn each on or off and mark it required. Their types are fixed, and you can add a description to guide how the agent asks for it.
  • Custom fields: extra details the agent collects in chat before saving the lead, such as company name or order size. Click Add data input, then set a Name, a Type (Text, Number, Boolean, Date or Email), a Description and Required. Untick Required to save the lead without that field.

The agent asks for every required field before saving the lead. Optional fields are saved when the customer gives them.

Example: a conversational lead

Name and Email on, with Email required, plus a custom text field company described as "The company the visitor works for".

WhoMessage
VisitorCan your team send a quote for 200 branded mugs?
AgentHappy to help. What's the best email to send the quote to?
Visitorsam@example.com. I'm Sam from Harbour Cafes.
AgentThanks, Sam. I've passed your details to our sales team, and they'll email your quote.

The lead is saved with the name, email and company, and appears under Activity › Leads.

UTM hidden fields

Turn on UTM hidden fields at the bottom of Fields to save which campaign brought each lead. It works in both modes, and visitors never see an extra field.

UTM hidden fields saves the visitor's campaign.

QwryAI saves the visitor's utm_source, utm_medium, utm_campaign, utm_term and utm_content with each lead and sends them in the leads.submit webhook. Pass them as user metadata when you identify the visitor; see UTM tracking. UTMs the visitor doesn't have are left out.

Messages

The Messages section appears only with Collect from a form. Both messages are required.

Success Message: shown when the lead is collected.

Dismiss Message: shown when the visitor dismisses the form.

Write the Success and Dismiss messages.

Destinations

Use Destinations to choose where leads are sent. Click Skip if you don't want to send them anywhere.

Destinations: where leads go.

Webhooks

Add one or more endpoints that receive each lead.

  1. Open Destinations

    Expand the Destinations section of the Action.

  2. Enter the endpoint URL

    Type the URL, for example https://mywebsite.com/webhooks. It must start with https://.

  3. Create the webhook

    Click Create webhook.

Email notification

Turn on Email notification to get an email every time a lead is collected through this Action. Add up to 10 recipients.

Where leads are saved

Every lead is saved under Activity › Leads with its conversation, then sent to your webhooks and email recipients.

Channels

Collect leads works on every channel except phone. Use Channels to turn it on or off for each one.

Channels for Collect leads.

Best practices

Frequently asked questions

Can I have more than one Collect leads Action on an agent?

No. Each agent has one. To collect other sets of details, add Collect data Actions, as many as your plan's Action limit allows.

Does the lead form work on WhatsApp and email?

The form shows only in the Chat bubble and Help page. On WhatsApp, email and other channels, the agent asks for the same fields in the conversation.

Will the agent show the form again after a visitor dismisses it?

It can. Dismissing the form shows your Dismiss Message. Whether the agent offers the form again depends on When to use, so say if it shouldn't ask again in the same conversation.

Can a custom field be a dropdown?

No. Custom fields can be Text, Number, Boolean, Date or Email. To steer answers, list the options in the field's description, for example "One of: Starter, Growth, Enterprise."

Where do I see my leads?

Under Activity › Leads in the sidebar. Leads are also sent to your webhooks and email recipients.

Next steps

Explore the documentation