🔍How to Capture Your Leads Through the Lynn’s Widgets
Last updated
Was this helpful?
Last updated
Was this helpful?
The Lead Capturing feature allows users to collect leads directly from their widget. This feature lets you capture essential user details such as email addresses, phone numbers, and other custom fields. You can customize messages displayed to users during the lead capture process and integrate these leads directly into your system using webhooks.
Access the Lead Capture Settings:
Navigate to the widget settings where you want to enable lead capturing.
Enable Lead Capturing:
Toggle the Enable Lead Capturing switch to turn on the lead capture feature.
Export Captured Leads:
Here you can use the Export Captured Leads button to download all captured leads in a CSV format.
Customize Acknowledgement and Session End Messages:
Acknowledgment Message: This message is displayed to users before collecting their details. Here you can edit the text to create a welcoming message.
Session End Message: This message is shown after collecting user details. Customize it to thank users or inform them of the next steps.
Configure Fields to Capture:
Click on the Fields to Capture section to add or edit fields.
Add Field: Once you select the field type from the Text, Number, Email, or Mobile Number fields, you can add the field to the questionnaire by clicking on this button.
For each field, set:
Request Message: The prompt shown to users asking for their information.
Appreciation Message: A confirmation message is shown after the user provides their details. Use placeholders like {{value}}
to dynamically insert user-provided information.
Webhook Connection:
To integrate lead data into your system in real-time, connect your widget to a webhook.
Enter the Webhook URL: Provide the endpoint URL where lead data will be sent.
Secret Key: For security purposes, use the provided secret key in your server to verify the authenticity of incoming requests.
When a lead is captured through Lynn's widget, the information is sent via a webhook. Here’s a breakdown of the webhook body content:
workspaceId: Unique identifier for your Lynn workspace.
widgetId: Identifier for the widget that captured the lead.
leadCaptureId: Unique ID for the lead capture event.
fieldValues: Contains the captured user data with a unique fieldId (e.g., name, email).
createdAt: Timestamp of when the lead was captured.
You may use this data to integrate captured leads into your CRM or database.
You can easily get the information you need from the request body, just like you would with any request. However, for added security and to prevent spam from people who are aware of your endpoint, it's a good idea to check the x-lynn-hmac-sha256
in the request header. This helps ensure that only legitimate requests are processed.
To verify the data's authenticity, encrypt the entire request body using HMAC-SHA256
with a secret key
that Lynn’s admin portal. Then compare the generated signature with the x-lynn-hmac-sha256
value in the request headers. If they match, it confirms the message's legitimacy.
The following Next.js code example demonstrates a secure way to handle webhook requests.
Testing the Webhook:
Once the webhook is connected, conduct tests to ensure that lead data is correctly being sent and received.
All captured leads can be reviewed and exported from the widget’s settings. Ensure your settings are correctly configured to prevent data loss and ensure compliance with data privacy regulations.
Note
Once you change the schema or the set of questions for lead capturing, the leads collected under the previous schema will be cleared. Therefore, we strongly recommend downloading the already captured leads before making any changes to the question schema.
The questionnaire will appear as soon as a user starts a conversation with Lynn, before Lynn responds to the user's first message.