I’d need to load and open the chat when the user press a button. Reading the docs it looked easy but for some reasons it doesn’t work.
First I set up not to load immediately with:
window.hsConversationsSettings = {
loadImmediately: false
};
Then, when the user press the button I fire:
window.HubSpotConversations.widget.load({ widgetOpen: true });
The chat loads, appears on screen but it is not open.
In other words
window.HubSpotConversations.widget.load({ widgetOpen: true });
and
window.HubSpotConversations.widget.load({ widgetOpen: false});
do the same thing.
Anyone could check this?
Thanks
Hey @pmontemc ,
Do you happen to have an example page I can look at? I did some testing with a test website I have (where the widget is set to not load immediately), and it looks like the following works when I run it in the console:
window.HubSpotConversations.widget.load({ widgetOpen: true });
If you wanted to test it yourself, you can navigate to my (very old and ugly) testing site: https://www.over-understanding.info
I can confirm that this does not work. Even on this “over-understanding” site, when running this command in the console, it does not work. Furthermore, I can see in the code for the conversations that the “load” method does not take in any arguments, as it states in the documentation.
widget: {
load: () => {
const widgetShell = createWidgetShell({
eventEmitter,
logError
});
widgetShell.loadWidget();
},
remove: widgetNotYetLoadedWarning,
open: widgetNotYetLoadedWarning,
close: widgetNotYetLoadedWarning,
refresh: widgetNotYetLoadedWarning,
status: () => ({
loaded: false
})
}
I am having the same problem right now.