Skip to content

πŸ–‡ Integrating Chatbot into Your Website

Sebastian MusiaΕ‚ edited this page Mar 15, 2024 · 1 revision

Enhance your website's interactivity and user engagement by seamlessly integrating our chatbot. Follow the simple steps below to implement the chatbot into your website:

Step 1: Locate Your HTML File

Identify the HTML file where you wish to add the chatbot. This will typically be in the root directory of your website or within a specific subdirectory if you aim to integrate the chatbot on a particular page.

Step 2 (a): Copy the Chatbot Integration Code

Below is the chatbot integration code snippet. This piece of code is designed to be lightweight and compatible with most web environments, ensuring a smooth integration process.

<script
  src="https://assistant.ai.boldare.dev/assets/js/ai-embedded.js"
  data-chat-initial="true"
  defer
></script>

We highly recommend inserting the code snippet just before the closing body tag of your HTML file. This placement ensures that the chatbot will load only after all other content on your page has fully loaded, optimizing your page's load time for a better user experience.

Step 2 (b): Customizing Chatbot Initialization

For a tailored interaction experience, you may prefer to manually initialize the chatbot rather than opting for automatic activation. This approach gives you greater control over the chatbot's initialization timing and its configuration, ensuring the chatbot seamlessly integrates with the flow of your website.

To prevent the chatbot from automatically initializing, locate and remove the following attribute from the chatbot integration code snippet: data-chat-initial="true"

For manual chatbot initialization, incorporate the following JavaScript code snippet into your website's JavaScript file. This script lets you dictate exactly when and how the chatbot becomes active on your site, offering the opportunity to customize its configuration further.

new AssistantIframe({
  url: `https://assistant.ai.boldare.dev/chat/iframe`
}).init();