Skip to main content

Chatbot Widget

Embed an AI-powered chatbot widget on your website to provide instant support and capture leads

Overview

The Chatbot widget displays a chat bubble on your website that visitors can click to open a conversation with an AI assistant. The chatbot is powered by Funnel Leasing's AI technology and can handle a variety of inquiries while capturing lead information for your leasing team.

Prerequisites

Before embedding the Chatbot widget, ensure you have:

  • Funnel Leasing API Key - Your Funnel Customer API Key (provided by Funnel Leasing)
  • Community ID - The ID of the community the chatbot is associated with
  • Website access - Ability to add script tags to your website's HTML

Installation

To embed the Chatbot widget on your website, add the following code to your HTML page. The script should be placed in the <head> section or just before the closing </body> tag:

Installation codeHTML
<script src="https://integrations.funnelleasing.com/gen-ai-chatbot/v1/funnel-gen-ai-chat.js"></script>
<script>
window.addEventListener('load', function () {
  window.FunnelGenAIChat.initialize({
    apiKey: 'YOUR_API_KEY_HERE',
    communityId: YOUR_COMMUNITY_ID_HERE,
    waitForMarketingInfo: false,
    leadSourceId: '1234',
    campaignInfo: 'a-string-of-text',
    enableGAEvents: true
  });
});
</script>

Configuration

The Chatbot widget accepts the following configuration parameters:

ParameterTypeRequiredDefaultDescription
apiKeystringYes-Funnel Customer API Key
communityIdnumberYes-The ID of the community the chatbot is associated with
waitForMarketingInfobooleanNofalseSet to true if you are using the DNI script. Causes the script to wait to initialize the Chatbot until marketing info is passed in
leadSourceIdstringNo-ID representing the lead source for tracking. If you are using the DNI script, this is not necessary
campaignInfostringNo-String of UTM parameters. If you are using the DNI script, this is not necessary
enableGAEventsbooleanNofalseIf set to true, the chatbot will pass the value to a variable called ENABLE_GA_EVENTS

Examples

Basic Chatbot

A minimal chatbot with only required parameters:

Basic implementationHTML
<script src="https://integrations.funnelleasing.com/gen-ai-chatbot/v1/funnel-gen-ai-chat.js"></script>
<script>
window.addEventListener('load', function () {
  window.FunnelGenAIChat.initialize({
    apiKey: 'your-api-key-here',
    communityId: 999
  });
});
</script>

Chatbot with DNI Integration

A chatbot configured to wait for marketing information from the DNI script:

DNI integrationHTML
<script src="https://integrations.funnelleasing.com/gen-ai-chatbot/v1/funnel-gen-ai-chat.js"></script>
<script>
window.addEventListener('load', function () {
  window.FunnelGenAIChat.initialize({
    apiKey: 'your-api-key-here',
    communityId: 999,
    waitForMarketingInfo: true
  });
});
</script>

Chatbot with Google Analytics Events

A chatbot configured to enable Google Analytics event tracking:

Google Analytics integrationHTML
<script src="https://integrations.funnelleasing.com/gen-ai-chatbot/v1/funnel-gen-ai-chat.js"></script>
<script>
window.addEventListener('load', function () {
  window.FunnelGenAIChat.initialize({
    apiKey: 'your-api-key-here',
    communityId: 999,
    enableGAEvents: true
  });
});
</script>

Chatbot with Manual Lead Source

A chatbot with manually specified lead source and campaign information:

Manual lead sourceHTML
<script src="https://integrations.funnelleasing.com/gen-ai-chatbot/v1/funnel-gen-ai-chat.js"></script>
<script>
window.addEventListener('load', function () {
  window.FunnelGenAIChat.initialize({
    apiKey: 'your-api-key-here',
    communityId: 999,
    leadSourceId: '1234',
    campaignInfo: 'utm_source=google&utm_medium=cpc&utm_campaign=summer2024'
  });
});
</script>

Chatbot Widget Code Generator

Use the code generator below to create custom chatbot widget code with your specific configuration:

Chatbot Widget Code Generator

Optional settings

Marketing Attribution

The Chatbot widget supports marketing attribution in two ways:

  • Using the DNI Script (Recommended) - When using Funnel's Dynamic Number Insertion (DNI) script, set waitForMarketingInfo to true. The DNI script will capture UTM parameters and referrer information, which will then be passed to the chatbot widget.
  • Manual Configuration - When not using the DNI script, you can manually specify leadSourceId and campaignInfo parameters. However, this approach is less flexible and requires manual updates when campaigns change.

Troubleshooting

Widget Not Appearing

  • Check script tags - Ensure the script tag is present and loads correctly
  • Verify API key - Confirm your API key is correct and wrapped in quotes
  • Check Community ID - Verify your Community ID is a number (without quotes)
  • Browser console - Check the browser console for JavaScript errors
  • Load event - Ensure the window.addEventListener('load', ...) wrapper is used to ensure the page is fully loaded

Chatbot Not Initializing

  • Check waitForMarketingInfo - If set to true, ensure the DNI script is present and functioning
  • Verify API key - Confirm your API key has the necessary permissions
  • Network tab - Check the browser's Network tab to see if initialization requests are being sent successfully

Marketing Attribution Not Working

  • DNI script - If using DNI, ensure waitForMarketingInfo is set to true and the DNI script is loaded before the chatbot script
  • Manual parameters - If not using DNI, ensure leadSourceId and campaignInfo are set correctly

Common Errors

ErrorSolution
API key is invalidContact Funnel Leasing support to verify your API key
Community ID not foundVerify the Community ID exists in your Funnel account
Chatbot not loadingCheck that the script source URL is accessible and not blocked by ad blockers
Marketing info not passedIf using DNI, ensure waitForMarketingInfo is true and DNI script loads first

Support

If you continue to experience issues after checking the troubleshooting steps above, please contact:

  • Customer Support: support@funnelleasing.com
  • Your Account Representative: Reach out to your assigned Funnel Leasing account representative