There are two ways to collect data from users when they engage with your AI Chat.
Through a form
Conversationally
There are pros and cons for each approach. Forms are easier to set up and is programmatic, but collecting information conversationally is more
natural and engaging despite the added complexity. You can send any collected data via webhook to a CRM as soon as your user submits it.
To add a form to your AI Chat, go to Customizations tab on the left navigation menu, then scroll down until you see the “Form” section.
You can select one of the default fields you’d like to include in the form. Alternatively, you can create custom fields.
For custom fields, you can change the field types (text, dropdown, checkbox). You can also make certain fields mandatory. If at least one field is
mandatory, you will also gain the option to make the entire form mandatory before the user can proceed with chatting. Making the form mandatory
will cause the “x” button on the top right of the form to disappear, thereby preventing users from closing the form before completing it.
If you want to maintain a natural conversational flow and collect data from users directly, you will have to configure your AI Agent(s) prompt and
set up variables to store the collected information.
The behavior of your AI Chat is governed by your AI Agent(s)‘s prompt. To review and edit the prompt, go to AI Agents
tab on the left navigation menu, then click on the Agent you’d like to edit.
If you created your AI Chat using a template, then you may be using a default
prompt we generated for you. If this is the first time you are configuring an
AI Agent prompt, we recommend you to read our Prompt Engineering guide for
best practices.
Configure your prompt to include detailed instructions for collecting user data. Make sure you cover when, what, and how. For example, here is a snippet
that can serve as a guide:
### Instructions- When engaging with the user for the first time, politely ask for their first name.- Once the user provides their first name, proceed with the following steps to collect their contact information.- Ask for the user's mobile telephone number after collecting their first name.- After the mobile telephone number is collected, ask for their e-mail address.- If the user is not comfortable providing any particular piece of information, do not force them. Respect their decision.
But this only directs the AI to ask for information from the user. We still need a way to store the collected information. Next, we’ll teach you how to store
the collected data into variables.
Go to Customizations tab on right navigation bar, then scroll down until you see “User Data Collection”. Click to expand it.
Inside, you can create variables to store information that is collected from the user during the conversation. You can set up multiple variables, each corresponding
to a single piece of information. When setting up a variable, please provide the variable name, description, and example values. Try to be as detailed and explicit
as possible.
The more examples you provide, the better it is for the AI to understand the format you’re looking for.Make sure to define enough variables to store all the information you are requesting from the user. In the example prompt snippet above, you would need the user’s name,
phone, and email.Once everything has been set up, you can test the AI Chat in preview mode. If everything works as intended, you should see the data being collected in your inbox every
time a user engages meaningfully with your AI Chat.
Variable values can change if the user specifies that they want to make a
correction or update. The AI is generally good at understanding the correct
value to assign.
Regardless of whether you want to collect data using a form or conversationally, you may wish to send that information to another CRM for follow up. GPT Chatbot supports
webhooks with smart triggers that can alert you to new leads as soon as they engage with the AI.Go to Customizations tab on the left navigation menu. Then scroll down to “Webhook”. Click to expand it.
If you are using a form, then you can select the “Form Submission” event and specify the API endpoint where you want the collected data to be sent (POST request).If you are using variables to store user data, then you can select the “Data Collection” event and choose the variables you’d like to be sent. Please note that the webhook
will only be triggered if all your designated variables have been collected (must not be empty).If you want certain variables to be optional, then you can give it a default value during variable setup. This way, it will always be in a populated state and never empty.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"GPT Chatbot API","colors":{"primary":"#2E3F51","light":"#516F90","dark":"#0D001D"},"favicon":"https://mintcdn.com/gptchatbot/et1nlYck1QOJbxxd/logo/favicon.png?fit=max\u0026auto=format\u0026n=et1nlYck1QOJbxxd\u0026q=85\u0026s=6887bcfb8c0877734cb5c8e2ba023c6b","logo":{"light":"https://mintcdn.com/gptchatbot/RpxSGx9HJ26aMoIb/logo/light.svg?fit=max\u0026auto=format\u0026n=RpxSGx9HJ26aMoIb\u0026q=85\u0026s=7a58afc2a4b648ed6b3344690bbc012d","dark":"https://mintcdn.com/gptchatbot/et1nlYck1QOJbxxd/logo/dark.svg?fit=max\u0026auto=format\u0026n=et1nlYck1QOJbxxd\u0026q=85\u0026s=18c489c900d7070d713b4e7232227076"},"api":{"mdx":{"server":"https://app.gptchatbot.it/api","auth":{"method":"bearer","name":null}}},"background":{"decoration":null,"color":{"light":null,"dark":"#111827"}},"navbar":{"links":[{"label":"Support","href":"mailto:info@gptchatbot.it"}],"primary":null},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"gptchatbot","hasAudioNarration":false,"actualSubdomain":"gptchatbot","customDomains":["docs.gptchatbot.it"],"gitSource":{"type":"github","owner":"federicodecillia","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a48af477c1f63e9b6f5a207","collectionId":"1d2bddc6-a57f-459a-bc5c-e13adf6914a7","schemaVersion":"v3"},"entitlements":{},"buildId":"6a48b0974fc0d1ab7935e1d6:success","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"API References","count":39},{"language":"default","tag":"Documentation","count":15},{"language":"default","tag":"Guides","count":12},{"language":"default","tag":"Data Sources","count":9},{"language":"default","tag":"Chatbots","count":6},{"language":"default","tag":"Session Messages","count":6},{"language":"default","tag":"Agents","count":5},{"language":"default","tag":"Chatbot Sessions","count":5},{"language":"default","tag":"API Usage Guides","count":4},{"language":"default","tag":"Data Source Tags","count":4}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"lead-collection","slug":"/lead-collection","pageMetadata":{"title":"Lead Collection","description":null,"href":"/lead-collection"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,Note,OptimizedImage}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`There are two ways to collect data from users when they engage with your AI Chat.`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Through a form`}),`\n`,_jsx(_components.li,{children:`Conversationally`}),`\n`]}),`\n`,_jsx(_components.p,{children:`There are pros and cons for each approach. Forms are easier to set up and is programmatic, but collecting information conversationally is more\nnatural and engaging despite the added complexity. You can send any collected data via webhook to a CRM as soon as your user submits it.`}),`\n`,_jsx(Heading,{level:`2`,id:`collecting-data-through-a-form`,children:`Collecting data through a form`}),`\n`,_jsx(_components.p,{children:`To add a form to your AI Chat, go to Customizations tab on the left navigation menu, then scroll down until you see the “Form” section.\nYou can select one of the default fields you’d like to include in the form. Alternatively, you can create custom fields.`}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-14.png?fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=09a77940f7762437f510d99dffa51bb5`,\"data-og-width\":`1049`,width:`1049`,\"data-og-height\":`831`,height:`831`,\"data-path\":`images/lead-collection-14.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-14.png?w=280\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=e3ccffd15120663d8ac1be6cc80be2ea 280w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-14.png?w=560\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=0d51fa92e723f395077d32151d4f178d 560w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-14.png?w=840\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=9d3c034c875c6a469ee606be2d955acd 840w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-14.png?w=1100\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=748d553c4c5df3cfe3c8d9e542afb83d 1100w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-14.png?w=1650\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=c778a041157b18900c95afe3d06540d3 1650w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-14.png?w=2500\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=7149fee81ba2ae7ed75e02ab42fe2dc6 2500w`})}),`\n`,_jsx(_components.p,{children:`For custom fields, you can change the field types (text, dropdown, checkbox). You can also make certain fields mandatory. If at least one field is\nmandatory, you will also gain the option to make the entire form mandatory before the user can proceed with chatting. Making the form mandatory\nwill cause the “x” button on the top right of the form to disappear, thereby preventing users from closing the form before completing it.`}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-15.png?fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=1c80d1b70eeb387b6f4514eece748083`,\"data-og-width\":`1057`,width:`1057`,\"data-og-height\":`624`,height:`624`,\"data-path\":`images/lead-collection-15.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-15.png?w=280\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=67e925f90d0ef5930575c5a05d64e9fa 280w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-15.png?w=560\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=abb8afc9b12b30617aafec3bcb7fd5f4 560w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-15.png?w=840\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=47349a2ed5ac9d74b8afc2c054b4f555 840w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-15.png?w=1100\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=fddacbe51a8e1e5e6dea4f31f69b42dc 1100w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-15.png?w=1650\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=08f1c344df2a19f4a4c86f44a5bc70bb 1650w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-15.png?w=2500\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=3a23ae3344b85a38ed759abc1967efae 2500w`})}),`\n`,_jsx(Heading,{level:`2`,id:`collecting-data-conversationally`,children:`Collecting data conversationally`}),`\n`,_jsx(_components.p,{children:`If you want to maintain a natural conversational flow and collect data from users directly, you will have to configure your AI Agent(s) prompt and\nset up variables to store the collected information.`}),`\n`,_jsx(Heading,{level:`3`,id:`editing-the-prompt`,children:`Editing the prompt`}),`\n`,_jsx(_components.p,{children:`The behavior of your AI Chat is governed by your AI Agent(s)‘s prompt. To review and edit the prompt, go to AI Agents\ntab on the left navigation menu, then click on the Agent you’d like to edit.`}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`If you created your AI Chat using a template, then you may be using a default\nprompt we generated for you. If this is the first time you are configuring an\nAI Agent prompt, we recommend you to read our Prompt Engineering guide for\nbest practices.`})}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-17.png?fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=61af853bfda65ef14db7282c64b69a12`,\"data-og-width\":`1848`,width:`1848`,\"data-og-height\":`904`,height:`904`,\"data-path\":`images/lead-collection-17.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-17.png?w=280\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=5bb1fe9232677e7e62d5eabb9a5e29d3 280w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-17.png?w=560\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=7793b0c3c57aa706159693823b2d2f8a 560w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-17.png?w=840\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=957adb384bdcd7d905116c4afc5397d0 840w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-17.png?w=1100\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=64a1bb200932b223c55edc42335a63d3 1100w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-17.png?w=1650\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=5aa4391e28a6dfcda22b1459697bad25 1650w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-17.png?w=2500\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=e73ccdbc89b8b2f7a3e74301bdf507b0 2500w`})}),`\n`,_jsx(_components.p,{children:`Configure your prompt to include detailed instructions for collecting user data. Make sure you cover when, what, and how. For example, here is a snippet\nthat can serve as a guide:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`7`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`### Instructions`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- When engaging with the user for the first time, politely ask for their first name.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Once the user provides their first name, proceed with the following steps to collect their contact information.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Ask for the user's mobile telephone number after collecting their first name.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- After the mobile telephone number is collected, ask for their e-mail address.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If the user is not comfortable providing any particular piece of information, do not force them. Respect their decision.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`But this only directs the AI to ask for information from the user. We still need a way to store the collected information. Next, we’ll teach you how to store\nthe collected data into variables.`}),`\n`,_jsx(Heading,{level:`3`,id:`setting-up-variables`,children:`Setting up variables`}),`\n`,_jsx(_components.p,{children:`Go to Customizations tab on right navigation bar, then scroll down until you see “User Data Collection”. Click to expand it.`}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-18.png?fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=12043154e48b0db9482c50841156b8b1`,\"data-og-width\":`1690`,width:`1690`,\"data-og-height\":`614`,height:`614`,\"data-path\":`images/lead-collection-18.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-18.png?w=280\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=ed6133f36a419da2f333bfcd6f8eb34b 280w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-18.png?w=560\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=6b1591cf3af7e1788b01d63587209634 560w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-18.png?w=840\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=5006a3df6b413ed61753aa22b8d6093b 840w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-18.png?w=1100\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=a21cf876ccf7e2e25dc7e4b6cf9408c3 1100w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-18.png?w=1650\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=c13167228d3f6d2928698c419996e877 1650w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-18.png?w=2500\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=dcfb14b75c709158e0b14df386b33574 2500w`})}),`\n`,_jsx(_components.p,{children:`Inside, you can create variables to store information that is collected from the user during the conversation. You can set up multiple variables, each corresponding\nto a single piece of information. When setting up a variable, please provide the variable name, description, and example values. Try to be as detailed and explicit\nas possible.`}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-19.png?fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=e02056747ee772384504be73cdd9ab30`,\"data-og-width\":`577`,width:`577`,\"data-og-height\":`822`,height:`822`,\"data-path\":`images/lead-collection-19.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-19.png?w=280\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=41410d19c189b18b0b52c1583ea1e96d 280w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-19.png?w=560\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=5781b40fddb9d3acda09a9d3f771250e 560w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-19.png?w=840\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=f5dcca957018469d6dbdb55d4f1756f3 840w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-19.png?w=1100\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=cbb9dc2e94ba7e55985209ff5109b9de 1100w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-19.png?w=1650\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=d53922bce57b59b9737991e00b81ee06 1650w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-19.png?w=2500\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=bdfd21b4521531d2b0dc9448e971415f 2500w`})}),`\n`,_jsx(_components.p,{children:_jsx(_components.em,{children:`The more examples you provide, the better it is for the AI to understand the format you’re looking for.`})}),`\n`,_jsx(_components.p,{children:`Make sure to define enough variables to store all the information you are requesting from the user. In the example prompt snippet above, you would need the user’s name,\nphone, and email.`}),`\n`,_jsx(_components.p,{children:`Once everything has been set up, you can test the AI Chat in preview mode. If everything works as intended, you should see the data being collected in your inbox every\ntime a user engages meaningfully with your AI Chat.`}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Variable values can change if the user specifies that they want to make a\ncorrection or update. The AI is generally good at understanding the correct\nvalue to assign.`})}),`\n`,_jsx(Heading,{level:`2`,id:`sending-data-to-your-crm`,children:`Sending data to your CRM`}),`\n`,_jsx(_components.p,{children:`Regardless of whether you want to collect data using a form or conversationally, you may wish to send that information to another CRM for follow up. GPT Chatbot supports\nwebhooks with smart triggers that can alert you to new leads as soon as they engage with the AI.`}),`\n`,_jsx(_components.p,{children:`Go to Customizations tab on the left navigation menu. Then scroll down to “Webhook”. Click to expand it.`}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-21.png?fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=d91ce6b268e90d8bf71bdeb08c35f570`,\"data-og-width\":`1676`,width:`1676`,\"data-og-height\":`1104`,height:`1104`,\"data-path\":`images/lead-collection-21.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-21.png?w=280\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=ae56be9bec2aedb489dea05c74c3417a 280w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-21.png?w=560\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=8148406103f720b542f1cc140e34e182 560w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-21.png?w=840\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=6b814324fd150dd951d7efa9b82e925e 840w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-21.png?w=1100\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=4caf9e61fe58c84ca41a109f93509446 1100w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-21.png?w=1650\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=d326764b8d4733c1d67c2b6fd24cff12 1650w, https://mintcdn.com/gptchatbot/8xjA4smDDdX6mwcs/images/lead-collection-21.png?w=2500\u0026fit=max\u0026auto=format\u0026n=8xjA4smDDdX6mwcs\u0026q=85\u0026s=580c218bd9e6144c572bace5f71331e9 2500w`})}),`\n`,_jsx(_components.p,{children:`If you are using a form, then you can select the “Form Submission” event and specify the API endpoint where you want the collected data to be sent (POST request).`}),`\n`,_jsxs(_components.p,{children:[`If you are using variables to store user data, then you can select the “Data Collection” event and choose the variables you’d like to be sent. `,_jsx(_components.strong,{children:`Please note that the webhook\nwill only be triggered if all your designated variables have been collected (must not be empty).`})]}),`\n`,_jsx(_components.p,{children:`If you want certain variables to be optional, then you can give it a default value during variable setup. This way, it will always be in a populated state and never empty.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Lead Collection","description":null,"href":"/lead-collection"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Collecting data through a form","slug":"collecting-data-through-a-form","depth":2,"children":[]},{"title":"Collecting data conversationally","slug":"collecting-data-conversationally","depth":2,"children":[{"title":"Editing the prompt","slug":"editing-the-prompt","depth":3,"children":[]},{"title":"Setting up variables","slug":"setting-up-variables","depth":3,"children":[]}]},{"title":"Sending data to your CRM","slug":"sending-data-to-your-crm","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"gptchatbot","siteName":"GPT Chatbot API","title":"Lead Collection - GPT Chatbot API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-04T06:59:33.125Z","originalFileLocation":"lead-collection.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"GPT Chatbot API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/gptchatbot/IDKThlX0BZP96Vwt/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/gptchatbot/IDKThlX0BZP96Vwt/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/gptchatbot/IDKThlX0BZP96Vwt/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/gptchatbot/IDKThlX0BZP96Vwt/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/gptchatbot/IDKThlX0BZP96Vwt/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/gptchatbot/IDKThlX0BZP96Vwt/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/gptchatbot/IDKThlX0BZP96Vwt/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/gptchatbot/IDKThlX0BZP96Vwt/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/gptchatbot/IDKThlX0BZP96Vwt/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Lead Collection - GPT Chatbot API\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"GPT Chatbot API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.gptchatbot.it/lead-collection\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://gptchatbot.mintlify.app/_mintlify/api/og/v2?division=Guides\u0026amp;title=Lead+Collection\u0026amp;theme=20e021f1004a9f9f06bad9ba\u0026amp;signature=a7c2ad341ea7cc5491e29b21a431181fe4ebc9a84b54e5a5ff5dff75bc62f964\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Lead Collection - GPT Chatbot API\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://gptchatbot.mintlify.app/_mintlify/api/og/v2?division=Guides\u0026amp;title=Lead+Collection\u0026amp;theme=20e021f1004a9f9f06bad9ba\u0026amp;signature=a7c2ad341ea7cc5491e29b21a431181fe4ebc9a84b54e5a5ff5dff75bc62f964\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/gptchatbot/IDKThlX0BZP96Vwt/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"GPT Chatbot API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2E3F51\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.gptchatbot.it/lead-collection\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/lead-collection.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.gptchatbot.it/#organization\",\"name\":\"GPT Chatbot API\",\"url\":\"https://docs.gptchatbot.it\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/gptchatbot/RpxSGx9HJ26aMoIb/logo/light.svg?fit=max\u0026auto=format\u0026n=RpxSGx9HJ26aMoIb\u0026q=85\u0026s=7a58afc2a4b648ed6b3344690bbc012d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.gptchatbot.it#website\",\"name\":\"GPT Chatbot API\",\"url\":\"https://docs.gptchatbot.it\",\"publisher\":{\"@id\":\"https://docs.gptchatbot.it/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.gptchatbot.it/lead-collection#webpage\",\"url\":\"https://docs.gptchatbot.it/lead-collection\",\"name\":\"Lead Collection\",\"dateModified\":\"2026-07-04T06:59:33.125Z\",\"isPartOf\":{\"@id\":\"https://docs.gptchatbot.it#website\"},\"breadcrumb\":{\"@id\":\"https://docs.gptchatbot.it/lead-collection#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.gptchatbot.it/lead-collection#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://docs.gptchatbot.it/creating-first-chatbot\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lead Collection\",\"item\":\"https://docs.gptchatbot.it/lead-collection\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.gptchatbot.it/lead-collection#article\",\"headline\":\"Lead Collection\",\"name\":\"Lead Collection\",\"url\":\"https://docs.gptchatbot.it/lead-collection\",\"mainEntityOfPage\":{\"@id\":\"https://docs.gptchatbot.it/lead-collection#webpage\"},\"dateModified\":\"2026-07-04T06:59:33.125Z\",\"publisher\":{\"@id\":\"https://docs.gptchatbot.it/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.gptchatbot.it#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"GPT Chatbot API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"GPT Chatbot API","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","groups":[{"group":"Getting Started","pages":[{"title":"Introduction","href":"/introduction"}]},{"group":"Guides","pages":[{"title":"Create Your First Chatbot","description":null,"href":"/creating-first-chatbot"},{"title":"Lead Collection","href":"/lead-collection"},{"title":"Human Support Escalation","description":null,"href":"/human-support-escalation"},{"title":"Inbox Notifications","href":"/inbox-notifications"},{"title":"Conversation Labeling","href":"/conversation-labeling"},{"title":"Multi-Agents Chatbot","href":"/multi-agents-chatbot"},{"title":"Fine Tuning Agent Intents","href":"/fine-tuning-agent-intents"},{"title":"AI Supervisor Overrides","href":"/supervisor-overrides"},{"title":"Bring Your Own Key (BYOK) and Pricing","href":"/byok-pricing-guide"},{"title":"Working with Tables and CSV","href":"/working-with-tables"},{"title":"Best practices for preparing training data","href":"/best-practices"},{"title":"Why does my chatbot not answer correctly?","href":"/help"}]},{"group":"Function Calling","pages":[{"title":"RAG from an External Data Provider","href":"/rag-from-external-data-provider"}]},{"group":"Authentication Webhook","pages":[{"title":"User Identity Verification","href":"/user-identity"}]}]},{"anchor":"API References","icon":"code","pages":[{"title":"API References","href":"/api-reference/api-key-setup"}]},{"anchor":"Tools","icon":"gear","pages":[{"title":"Tools","href":"/tools/tools-intro"}]}]},"basePath":"","title":"Lead Collection - GPT Chatbot API","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-DW6UFrUy.js","DynamicMarkdown-B62XqCSI.js","zoom-image-lightbox-eHyQ0tlO.js","lightbox-handle-r17bVUz3.js"]}