Choose one of the methods below to add the chatbot to your CivicPlus website.
Add this code snippet to your website's footer or before the closing </body> tag:
<!-- Municipal Chatbot Widget -->
<script>
(function(w,d,s,o,f,js,fjs){
w['MunicipalChatbot']=o;w[o] = w[o] || function () {
(w[o].q = w[o].q || []).push(arguments)
};
js = d.createElement(s), fjs = d.getElementsByTagName(s)[0];
js.id = o; js.src = f; js.async = 1;
fjs.parentNode.insertBefore(js, fjs);
}(window, document, 'script', 'MunicipalChatbot',
'https://your-domain.com/widget.js'));
// Initialize with your bot ID
MunicipalChatbot('init', {
botId: 'chatham-ma', // Replace with your bot ID
autoOpen: false, // Set to true to auto-open on page load
delay: 3000 // Delay in ms before auto-opening
});
</script>
chatham-ma with your unique bot ID provided during setup.
For a full-screen overlay experience identical to Frase:
<!-- Full-screen chatbot iframe -->
<iframe
title="Municipal ChatBot"
id="municipal-chatbot-iframe"
src="https://your-domain.com/embed/chatham-ma"
style="border: none;
right: 0px;
position: fixed;
z-index: 2147483647;
height: 100dvh;
width: 100dvw;
margin-right: 0px;
margin-bottom: 0px;
background: transparent;
bottom: 0px;"
></iframe>
Embed the chatbot in a specific page section (e.g., a "Contact Us" page):
<!-- Container for embedded chatbot -->
<div id="chatbot-container" style="width: 100%; height: 600px;">
<iframe
src="https://your-domain.com/embed/chatham-ma"
style="width: 100%;
height: 100%;
border: 1px solid #ddd;
border-radius: 8px;"
title="Municipal ChatBot"
></iframe>
</div>
When using Method 1 (Widget), you can customize behavior:
MunicipalChatbot('init', {
botId: 'your-bot-id', // Required: Your unique bot ID
apiUrl: 'https://...', // Optional: Custom API URL
autoOpen: false, // Auto-open on page load
delay: 3000, // Delay before auto-opening (ms)
position: 'bottom-right' // Button position
});
Contact our support team at [email protected]
Click the button below to see the widget in action: