rival-black
rival-black2y ago

Chatbot active in webpage

Hi. Is it possible to embed a chat bot in a web page that is open/maximise upon arrival to the page?
2 Replies
Tico | Voiceflow Assistant
Yes, it's possible to embed a chatbot in a webpage that opens upon arrival to the page using Voiceflow's Web Chat integration. You can use the JavaScript API provided by Voiceflow to programmatically control the chat widget's behavior. Here's a simple example of how you can achieve this:
window.voiceflow.chat.load({
verify: {
projectID: 'your_project_id'
},
versionID: 'production'
}).then(() => {
setTimeout(function () {
window.voiceflow.chat.open();
}, 1000);
});
window.voiceflow.chat.load({
verify: {
projectID: 'your_project_id'
},
versionID: 'production'
}).then(() => {
setTimeout(function () {
window.voiceflow.chat.open();
}, 1000);
});
In this example, the load method is used to load a specific Voiceflow agent on the webpage. The open method is then used to open the Web Chat widget window. The setTimeout function is used to delay the opening of the chat widget by 1 second (1000 milliseconds) after the page loads. Remember to replace 'your_project_id' with the actual project ID of your Voiceflow project. The versionID is set to 'production' to use the production version of your design. Please note that this is a basic example. You can further customize the chat widget's behavior and appearance according to your needs using the various configuration options and methods provided by the Voiceflow JavaScript API.
rival-black
rival-blackOP2y ago
Is this code embedded in the web page or the chatbot? It's OK I've added it to the existing code in the webpage and it works.

Did you find this page helpful?