Cognitium AI Chat Widget Setup Documentation

Your complete guide to installing and configuring the Cognitium AI Chat Widget on your website.

Download the Chat Widget files from your user panel after logging in.

Login to Download

Getting Started

This guide will walk you through installing and configuring the Cognitium AI Chat Widget on your website. The widget consists of two files: chat.php and config.json.

Step 1: Download and Place the Files

Step 2: Configure config.json

Open the config.json file in your favorite text editor. This file is divided into three main sections: api, appearance, and logging.

API Configuration

In the api section, update the following values with your credentials:

Appearance Settings

The appearance section controls the look and feel of the chat widget. Here are the available options:

Logging Options

The logging section lets you control PHP error logging:

Step 3: Include the Chat Widget in Your Webpage

To add the chat widget to your website, include the following script tag on any page (preferably just before the closing </body> tag):

<!-- Include jQuery if not already included -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<!-- Include the Chat Widget -->
<script src="/chat.php?load=chatwidget"></script>
  

This script dynamically loads the chat widget. A chat bubble will appear at the bottom-right corner of your page. When clicked, it opens the full chat interface.

Step 4: Test the Chat Widget

Additional Information

The chat widget sends user messages to a remote API that returns responses (and may also include link previews). If you encounter any issues, ensure that:

For further customization options and advanced configurations, refer to the inline comments in chat.php.

Conclusion

After following these steps, your Cognitium AI Chat Widget should be fully operational on your website. You can further customize its appearance and behavior by tweaking the settings in config.json as needed.

Sample Integration Template

The sample code below demonstrates how to integrate the widget into a simple HTML page:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Chat Test</title>
    <!-- Tailwind CSS -->
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
    <!-- jQuery -->
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
</head>
<body>
    <!-- Chat Widget Script -->
    <script src="/chat.php?load=chatwidget"></script>
</body>
</html>
  
Footer Example

Ready to Transform Your Customer Support?

Join us using Cognitium