Automatically open chat widget
Hi All, is it possible to open the widget automatically if you use a specific link parameter for example "/?OpenChat=true". I don't want the widget to open every time just with a specific link which i can use for a qr code. Thanks for the help.
1 Reply
Yep – you can do it with one small script.
1. Load the widget as usual with
• Visiting the page without that parameter leaves the launcher closed as usual.
• You can adapt the flag name/value to whatever you like. Reference: “Custom triggers” – Voiceflow Web Chat API docs (window.voiceflow.chat.open/close/show/hide). https://docs.voiceflow.com/docs/custom-triggers
window.voiceflow.chat.load({...})
.
2. Right after the load call, check the current URL for a query-string flag (e.g. ?OpenChat=true
).
3. If the flag is present, call the Web Chat API’s window.voiceflow.chat.open()
method to pop the widget open.
• Scan the QR code to a URL like https://your-site.com/?OpenChat=true
, and the widget auto-opens.• Visiting the page without that parameter leaves the launcher closed as usual.
• You can adapt the flag name/value to whatever you like. Reference: “Custom triggers” – Voiceflow Web Chat API docs (window.voiceflow.chat.open/close/show/hide). https://docs.voiceflow.com/docs/custom-triggers