APIs & Integrations

chriscardone
メンバー

Opening live chat via javascript

解決

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 いいね!
2件の承認済みベストアンサー
IsaacTakushi
解決策
HubSpot Employee
HubSpot Employee

Opening live chat via javascript

解決

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 いいね!
cbarley
解決策
元HubSpot社員
元HubSpot社員

Opening live chat via javascript

解決

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();  

 

元の投稿で解決策を見る

6件の返信
hakanproax
投稿者

Opening live chat via javascript

解決

Hi all,

 

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

 

0 いいね!
peacepostman
メンバー

Opening live chat via javascript

解決

Hello,

 

We succeed using this javascript call:

 

// Open chat
HubSpotConversations.widget.open()

// Close chat
HubSpotConversations.widget.close()

Best regards,

0 いいね!
tjoyce
名誉エキスパート | Elite Partner
名誉エキスパート | Elite Partner

Opening live chat via javascript

解決

You could also do -

hubspot.messages.EXPERIMENTAL_API.requestWidgetOpen()

---

tim@belch.io

0 いいね!
cbarley
解決策
元HubSpot社員
元HubSpot社員

Opening live chat via javascript

解決

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
参加者

Opening live chat via javascript

解決

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
解決策
HubSpot Employee
HubSpot Employee

Opening live chat via javascript

解決

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 いいね!