Lynn
  • Lynn’s User Guide
  • 📖Building Up the Knowledge Base
  • 🛠️Creating a Widget
  • 📝Add Suggested Questions to Your Widget
  • 📗How to Update Your Knowledge Base
  • 🖋️Setting Up Model Answers
  • 🎗️How to Embed A Chat Widget
  • 💬Personality Customization
  • 🦸How to Handover to Human Support
  • 📈Trending Topics: AI Categorisation for Insightful Conversation Analysis
  • 📊Reports Dashboard
  • 🪄Lynn Javascript API
  • 🏉Webhooks
    • Next.js
  • 🎭How to Integrate Tidio with Lynn for Seamless Customer Support with Live Agents
  • 🔍How to Capture Your Leads Through the Lynn’s Widgets
    • Next.js
Powered by GitBook
On this page
  • How to Enable Lead Capturing
  • Customizing Messages and Fields
  • Integrating with Webhooks
  • Managing and Exporting Leads

Was this helpful?

How to Capture Your Leads Through the Lynn’s Widgets

PreviousHow to Integrate Tidio with Lynn for Seamless Customer Support with Live AgentsNextNext.js

Last updated 9 months ago

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.

How to Enable Lead Capturing

  1. Access the Lead Capture Settings:

    • Navigate to the widget settings where you want to enable lead capturing.

  2. Enable Lead Capturing:

    • Toggle the Enable Lead Capturing switch to turn on the lead capture feature.

  3. Export Captured Leads:

    • Here you can use the Export Captured Leads button to download all captured leads in a CSV format.

Customizing Messages and Fields

  1. 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.

  2. 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.

Integrating with Webhooks

  1. 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": "qprBF5koDdOjmdCPikl2",
      "widgetId": "fwanJl2WUoFqqUkilAKe",
      "leadCaptureId": "RCvTDLf0K3qLN1or3S5Z",
      "fieldValues": {
        "eCQUiOd7YbIGQei0ZMA1o": "Kumuthu",
        "fLR4QPLDMIDaL3jsaKGmI": "email@lynn.chat"
      },
      "createdAt": "2024-09-01T14:31:59.906Z"
    }
    • 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.

    Receiving the Request

    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.

    Next.js

  2. Testing the Webhook:

    • Once the webhook is connected, conduct tests to ensure that lead data is correctly being sent and received.

Managing and Exporting Leads

  • 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.

🔍