Embedding Cognipeer Webchat on Your Website: A Complete Integration Guide
Cognipeer allows you to easily transform your website into an intelligent and interactive platform by integrating a Peer via webchat. By adding your website as a datasource and connecting it to your Peer, visitors can receive instant, contextually accurate responses based on your site's content. This guide walks you through every step of the process, including embedding the Cognipeer Webchat on custom websites, WordPress, and other popular CMS platforms.
Step 1: Adding Your Website as a Datasource in Cognipeer
To make your website content available for your Peer:
- Navigate to your Cognipeer Dashboard and select Datasources.
- Click on Add Datasource and select the option for Website.
- Enter your website’s URL and complete the necessary details.
- Save the datasource and verify it is indexed properly.
Step 2: Creating and Configuring Your Peer
Once your website content is indexed:
- Go to the Peer List and create a new Peer, or choose an existing one.
- Clearly define the Topics, outlining exactly what your Peer can and cannot do.
- Under Actions, select read-datasource and connect your newly created website datasource.
Important: Ensure your Peer and the datasource are correctly connected to allow accurate content retrieval.
- Configure advanced settings (text/vector weights, search limits, etc.) according to your requirements.
Step 3: Configuring the Webchat Integration
To enable webchat functionality:
- In your Peer’s detail page, navigate to the Integrations tab.
- Choose Webchat from the available integration options.
- Customize the appearance, welcome message, and interaction settings of your webchat interface.
- Save your configuration to activate webchat integration.
Step 4: Embedding Cognipeer Webchat into Your Website
Cognipeer generates a custom script snippet to easily embed your Peer’s webchat directly into your site.
Custom HTML or Static Websites
If you’re using a custom-built or static website:
- Copy the generated embed script from your Cognipeer integration settings.
- Paste it directly before the closing
</body>tag in your HTML file.
Example:
<html>
<head>
...
</head>
<body>
...
<!-- Paste your Cognipeer Webchat embed script here -->
<script src="https://app.cognipeer.com/scripts/cognipeer.sdk.js"></script>
<script>
window.cognipeer.chat({ hookId: "hook_id" });
</script>
</body>
</html>For WordPress Sites
Option 1 – Direct Theme Edit:
- Go to Appearance → Theme File Editor.
- Open
footer.php. - Paste the script before
</body>, then save.
Option 2 – Using a Plugin:
- Install Insert Headers and Footers plugin.
- Go to Settings → Insert Headers and Footers.
- Paste the script in the Footer section.
For Other Platforms
Wix:
- Go to Settings → Custom Code.
- Add your script to the body/footer section and publish.
Squarespace:
- Navigate to Settings → Advanced → Code Injection.
- Paste the script into the Footer box and save.
Step 5: Test the Integration
- Reload your website and confirm the webchat appears.
- Interact with the Peer to ensure:
- The webchat loads successfully.
- The Peer responds accurately using the connected website datasource.
Tips for Better Results
Datasource content not showing in responses?
Re-check the connection between Peer and datasource.Incorrect answers?
Ensure the Topic and action are properly defined and the website is fully indexed.Need to update content?
Re-crawl the datasource after website changes to keep the Peer up to date.Wrap-Up
With just a few steps, you can integrate Cognipeer’s powerful AI-driven Webchat into your website—backed by real content from your own site. Whether you're running a custom site, WordPress, or a CMS like Wix or Squarespace, the process is seamless and highly flexible. This makes it easy to offer 24/7 automated support, dynamic content responses, and a smarter user experience—all powered by your Peer.

