How to start a fresh webchat widget session on every new tab opened with the same domain url

Hi,
Facing an issue as -

When I am accessing my project domain URL in multiple tabs, I was able to see the previous tab active web chat session in a new tab by automatically opening the widget chat form...

I am expecting like - whenever I am accessing the same domain URL in a new tab, it should display the chat button at the right, and clicking on the chat button should start a new chat session.

This is feature How Genesys Widgets works - Genesys Documentation

How session recovery works after closing and opening the browser within the same domain

Genesys Widgets uses session cookies, which persist until you completely exit your browser application. When viewing an active chat session, closing the current window will not eliminate the session cookie, unless the action taken also exited the browser completely.

If you close the browser window or tab running the chat session, but you do not exit the browser completely, returning to that domain in another window or tab will restore the chat session.

Oh,
Can you please guide me on how to show the chat widget button only on a few screens(login/forgot) in an application but not on all the screens, so to hide the chat button I have written a set time interval function to hide it as I couldn't find a way to hide the widget button dynamically based on screens/domain URL...

widgets: {

main: {

    debug: false,

    theme: "light",

    lang: "en",

    customStylesheetID: "genesys_widgets_custom",

    preload: ['webchat'],

    // OR define the JSON object inline

    i18n: {

        "en": {

            "webchat": {

                "ChatTitle": "Chat with us",

            }

        }

    }

},

webchat: {

    userData: {},

    emojis: true,

    cometD: {

        enabled: false

    },

    autoInvite: {

        enabled: false,

        timeToInviteSeconds: 5,

        inviteTimeoutSeconds: 30

    },

    chatButton: {

            enabled: false,

            'template': '<div class="cx-widget cx-webchat-chat-button cx-side-button" id="geneChatButton" onclick="myChatButton()" role="button" tabindex="0" data-message="ChatButton" data-gcb-service-node="true"><span class="cx-icon" data-icon="chat"></span><span class="i18n cx-chat-button-label" data-message="ChatButton"></span></div>',

            openDelay: 2500,

            effectDuration: 300,

            hideDuringInvite: true

    },

    form: {

        wrapper: "<table></table>",

       

    },

    uploadsEnabled: true,

    enableCustomHeader: true,

    transport: {

        dataURL: "",

        type: "",

        endpoint: "",

        headers: {

            "x-api-key": ""

        },

        stream: "qa"

    }

},

onReady: function(){

    var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin');

    oMyPlugin.command('WebChat.showChatButton', {

        openDelay:1000,

        duration: 1000
    }).done(function(e){
        document.getElementById("geneChatButton").style.visibility = "hidden";
            setInterval(() => {
                if (sessionStorage.getItem("$screen") === 'login' || sessionStorage.getItem("$screen") === 'forget') {
                    document.getElementById("geneChatButton").style.visibility = "unset";
                } else {
                   document.getElementById("geneChatButton").style.visibility = "hidden";
                }
            }, 1000);


    }).fail(function(e){

    });

}

}

But using this set interval method, sometimes the button is not hiding properly and able to see at login screen as well.

Any update on above chat button issue, please

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