adverse-sapphire
adverse-sapphire15mo ago

Open in full screen mode.

Can someone show me how to modify the embed code to open my chatbot in full screen mode on page load?
3 Replies
Tico | Voiceflow Assistant
To automatically open the Webchat when a user lands on your website, you need to modify the code snippet slightly. The function that opens the chatbot is window.voiceflow.chat.open(). You also need to add a slight delay so it can render properly. Here's what the modified code should look like:
(function(d, t) {
var v = d.createElement(t), s = d.getElementsByTagName(t)[0];
v.onload = function() {
window.voiceflow.chat.load({
verify: { projectID: 'YOUR_PROJECT_ID' },
url: 'https://general-runtime.voiceflow.com/',
versionID: 'production'
}).then(() => {
setTimeout(function() {
window.voiceflow.chat.open();
}, 1000);
});
}
v.src = "https://cdn.voiceflow.com/widget/bundle.mjs";
v.type = "text/javascript";
s.parentNode.insertBefore(v, s);
})(document, 'script');
(function(d, t) {
var v = d.createElement(t), s = d.getElementsByTagName(t)[0];
v.onload = function() {
window.voiceflow.chat.load({
verify: { projectID: 'YOUR_PROJECT_ID' },
url: 'https://general-runtime.voiceflow.com/',
versionID: 'production'
}).then(() => {
setTimeout(function() {
window.voiceflow.chat.open();
}, 1000);
});
}
v.src = "https://cdn.voiceflow.com/widget/bundle.mjs";
v.type = "text/javascript";
s.parentNode.insertBefore(v, s);
})(document, 'script');
Remember to replace 'YOUR_PROJECT_ID' with your actual project ID. For more details on other functions that the webchat can perform, you can refer to the Voiceflow documentation.
adverse-sapphire
adverse-sapphireOP15mo ago
Thanks! That works!
W. Williams (SFT)
Voiceflow
Embed & Customize Styling
Modify the CSS of your web chat and embed it within a page

Did you find this page helpful?