APIs & Integrations

chriscardone
Membro

Opening live chat via javascript

resolver

We're trying to make it so a button can open the live chat widget via javascript, how could we do this?

(by live chat, I am referring to the hubspot live chat widget)

0 Avaliação positiva
2 Solução aceitas
IsaacTakushi
Solução
HubSpot Employee
HubSpot Employee

Opening live chat via javascript

resolver

Hi, @Chris_Cardone.

Your request seems similar to this topic. If you use JavaScript to append #hs-chat-open to the end of the URL, the chat widget will open immediately.

Check out the documentation here .

This feature was implemented due to feedback on this HubSpot Community request . The thread includes some helpful code examples from other developers.

Isaac Takushi

Associate Certification Manager

Exibir solução no post original

0 Avaliação positiva
cbarley
Solução
Alunos da HubSpot
Alunos da HubSpot

Opening live chat via javascript

resolver

hi @chriscardone and @tjoyce , we also just released a Conversations Live Chat Widget API, where you can use this this function to open the widget:

 

window.HubSpotConversations.widget.open();  

 

Exibir solução no post original

6 Respostas 6
hakanproax
Colaborador(a)

Opening live chat via javascript

resolver

Hi all,

 

Is it possible to hide bubble on mobile and only allow users to open with link clicking?

 

0 Avaliação positiva
peacepostman
Membro

Opening live chat via javascript

resolver

Hello,

 

We succeed using this javascript call:

 

// Open chat
HubSpotConversations.widget.open()

// Close chat
HubSpotConversations.widget.close()

Best regards,

0 Avaliação positiva
tjoyce
Especialista reconhecido(a) | Parceiro Elite
Especialista reconhecido(a) | Parceiro Elite

Opening live chat via javascript

resolver

You could also do -

hubspot.messages.EXPERIMENTAL_API.requestWidgetOpen()

---

tim@belch.io

0 Avaliação positiva
cbarley
Solução
Alunos da HubSpot
Alunos da HubSpot

Opening live chat via javascript

resolver

hi @chriscardone and @tjoyce , we also just released a Conversations Live Chat Widget API, where you can use this this function to open the widget:

 

window.HubSpotConversations.widget.open();  

 

rampatra
Participante

Opening live chat via javascript

resolver

This worked for me. Also, is there a way to also type in a default message automatically from the user side when the window opens?

IsaacTakushi
Solução
HubSpot Employee
HubSpot Employee

Opening live chat via javascript

resolver

Hi, @Chris_Cardone.

Your request seems similar to this topic. If you use JavaScript to append #hs-chat-open to the end of the URL, the chat widget will open immediately.

Check out the documentation here .

This feature was implemented due to feedback on this HubSpot Community request . The thread includes some helpful code examples from other developers.

Isaac Takushi

Associate Certification Manager
0 Avaliação positiva