Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Chat widget refresh

    Posted 06-05-2025 19:22

    mahesh_pillai | 2021-10-19 14:44:35 UTC | #1

    Hi,

    We have a version 2 chat and the chat disconnects if the user refreshes the chat widget page when it is in progress. Is there a way we can keep the session live even if the page is refreshed?

    Regards, Mahesh


    tim.smith | 2021-10-19 16:56:04 UTC | #2

    The widget should reconnect as its default behavior. Please open a case with Genesys Cloud Care to investigate the widget's behavior.


    mahesh_pillai | 2021-10-25 16:49:34 UTC | #3

    Hi Tim,

    The widget is getting invoked when the page is getting loaded. Since the page is getting refreshed it is getting reloaded. I am raising a case with GC for the same.

    Meanwhile, can you share an example code for this?

    Regards, Mahesh


    tim.smith | 2021-10-25 16:54:09 UTC | #4

    Details on implementing the web chat v2 widget can be found here: https://developer.genesys.cloud/api/digital/webchat/widget-version2


    mahesh_pillai | 2021-10-26 12:19:16 UTC | #5

    I have already gone through the documentation and it does talk on the reconnect issue that I am facing. Below is the code that is being used. Can you please validate and let me know what needs to be done

    <script src="https://apps.mypurecloud.ie/widgets/9.0/cxbus.min.js" onload="javascript:CXBus.configure({debug:false,pluginsPath:'https://apps.mypurecloud.ie/widgets/9.0/plugins/'}); CXBus.loadPlugin('widgets-core');"></script>

    <script>

    window.genesys = { "widgets": { main: { theme:"light", lang: "vietnam", i18n: "https://jsonkeeper.com/b/1X68" }, "webchat": { "transport": { "type": "purecloud-v2-sockets", "dataURL": "https://api.mypurecloud.ie", "deploymentKey": "XXXXXX", "orgGuid": "XXXXXX, "interactionData": { "routing": { "targetType": "QUEUE", "targetAddress": AllOtherChat", "priority": 2 } } }, "userData": { "addressStreet": "", "addressCity": "", "addressPostalCode": "", "addressState": "", "phoneNumber": "", "customField1Label": "", "customField1": "", "customField2Label": "", "customField2": "", "customField3Label": "", "customField3": "" } } } };

    function getAdvancedConfig() { return { "form": { "autoSubmit": false, "firstname": "test", "lastname": "", "email": "", "subject": "" }, "formJSON": { "wrapper": "<table></table>", "inputs": [ { "id": "cxwebchatformfirstname", "name": "firstname", "maxlength": "100", "label": "First Name" }, { "id": "cxwebchatformlastname", "name": "lastname", "maxlength": "100", "placeholder": "Required", "label": "Last Name" }, { "id": "cxwebchatformemail", "color":"#FFFFFF", "name": "email", "maxlength": "100", "placeholder": "Optional", "label": "Email" }, { "id": "cxwebchatformsubject", "name": "subject", "maxlength": "100", "placeholder": "Optional", "label": "Subject" }, { "id":"cxwebchatform_enquirytype", "name":"language", "type":"select", "label":"Language", "options":[

    { "text":"English", "value":"en", "selected":true }, { "text":"Cantonese (Chinese Traditional)", "value":"zh-TW" }, { "text":"Chinese Simplified", "value":"zh-CN" }, { "text":"Japanese", "value":"ja" }, { "text":"French", "value":"fr" } ] } ] } }; }

    const customPlugin = CXBus.registerPlugin('Custom'); </script>

    <button type="button" id="chat-button" onclick="customPlugin.command('WebChat.open', getAdvancedConfig());">Start Chat</button>


    system | 2021-11-26 12:20:08 UTC | #6

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 12407