Tickets & Conversations

zogics
Participant

launching chat from a link

SOLVE

We would like to be able to launch the chat conversation from the click of a link. We have a couple of uses cases on our e-commerce site:

 

1) is the "Talk to an Expert" link on our product description pages like here:

https://zogics.com/gym-wipes/antibacterial-gym-wipes-z800-4-rolls-case

(located under quantity option and above add to cart button)

2) the "click here" text link after "Chat:"

3) In our footer - the live chat option 

 

We migrated our chat service from SnapEngage - and we used to use JavaScript to make this happen.

 

<a onclick="return SnapEngage.startLink();" href="javascript&colon;void(0);" title="Talk to an Expert">Talk To An Expert</a>

 

Does anyone know the equivalent on click link for the HubSpot chat? Or an alternative solution?

3 Accepted solutions
MFrankJohnson
Solution
Thought Leader

launching chat from a link

SOLVE

Try this ...

<a id="click-to-chat__cta--text" class="cta cta--blue" style="margin-top: 20px;" onclick="window.hubspot.messages.EXPERIMENTAL_API.requestWidgetOpen();">Chat with Sales</a>

 

Note: Please search for recent posts as HubSpot evolves to be the #1 CRM platform of choice world-wide.

 

Hope that helps.

 

Be well,
Frank


www.mfrankjohnson.com

View solution in original post

Solution
Anonymous
Not applicable

launching chat from a link

SOLVE

No code required, just "Append #hs-chat-open to the end of your URL to trigger the chat widget launch."

 

Reference: https://knowledge.hubspot.com/articles/kcs_article/conversations/chat-with-your-website-visitors

 

🙂 

View solution in original post

cquesadad
Solution
Participant

launching chat from a link

SOLVE

Perfect! I understod: here the complete solution that wordked for me:

 

<a id="click-to-chat__cta--text" class="cta cta--blue" style="margin-top: 20px;" onclick="window.HubSpotConversations.widget.open()" href="#hs-chat-open">Chat with Sales</a>

View solution in original post

33 Replies 33
MatthewShepherd
Key Advisor

launching chat from a link

SOLVE

For anyone looking to not load their chat widget at all until a button is clicked (rather than popping open a chat widget that has already loaded as discussed above), take a look at this post: https://community.hubspot.com/t5/Tips-Tricks-Best-Practices/onclick-action-doesn-t-work/m-p/457288#M...

Matthew Shepherd

Freelance HubSpot Consultant
CRM Consultant | SEO Specialist

Did my post help answer your query?Help the community by marking it as a solution.
pixii
Participant

launching chat from a link

SOLVE

@mediPr I had the same thing happen to buttons across my entire site, sometime in the last few weeks.

 

I found something that works.

 

Solution:

 

Where your code had:

onclick="window.hubspot.messages.EXPERIMENTAL_API.requestWidgetOpen();"

 

Replace with:

onclick="window.HubSpotConversations.widget.open();"

 

This should fix it.

mediPr
Participant

launching chat from a link

SOLVE

Hi, thanks so much. Excellent. This solved my issue!

sharonlicari
Community Manager
Community Manager

launching chat from a link

SOLVE

Thank you for sharing @pixii 


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




mediPr
Participant

launching chat from a link

SOLVE

I implemented this on my websites and it was working, but a recent update seems to have broken it on two independent website. Anyone experiencing the same? Any solutions? Thanks

0 Upvotes
PamCotton
Community Manager
Community Manager

launching chat from a link

SOLVE

Hello @mediPr 

 

Would you be able to provide us more information about what is happening in your end?  The more information, screenshots, and details you can provide, the better I can advise on the next steps.

 

Thank you,

Pam

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes
MFrankJohnson
Solution
Thought Leader

launching chat from a link

SOLVE

Try this ...

<a id="click-to-chat__cta--text" class="cta cta--blue" style="margin-top: 20px;" onclick="window.hubspot.messages.EXPERIMENTAL_API.requestWidgetOpen();">Chat with Sales</a>

 

Note: Please search for recent posts as HubSpot evolves to be the #1 CRM platform of choice world-wide.

 

Hope that helps.

 

Be well,
Frank


www.mfrankjohnson.com
WareWorks
Member

launching chat from a link

SOLVE

Hi Frank

 

This is not working for me and generating a client side error, Any idea about this?

 

Uncaught TypeError: Cannot read property 'messages' of undefined
at HTMLAnchorElement.onclick ((index):503)

 

0 Upvotes
MiaSrebrnjak
Community Manager
Community Manager

launching chat from a link

SOLVE

HI @WareWorks,

 

Welcome to the Community! It would be great if you can share which troubleshooting steps you have taken so far and include a screenshot of the error so the Community has more information to work with. 

 

Thanks

Mia 


Wusstest du, dass es auch eine DACH-Community gibt?
Nimm an regionalen Unterhaltungen teil, indem du deine Spracheinstellungen änderst


Did you know that the Community is available in other languages?
Join regional conversations by
changing your language settings

WareWorks
Member

launching chat from a link

SOLVE

Hi Mia

 

I have resolved this issue. Thank you for your help. 

 

WW

MiaSrebrnjak
Community Manager
Community Manager

launching chat from a link

SOLVE

Thank you @WareWorks, I'm glad you were able to find a solution!

 

Have a great rest of your day

Mia 


Wusstest du, dass es auch eine DACH-Community gibt?
Nimm an regionalen Unterhaltungen teil, indem du deine Spracheinstellungen änderst


Did you know that the Community is available in other languages?
Join regional conversations by
changing your language settings

RZhang
Member

launching chat from a link

SOLVE

Hi  i have tried it, but i dont work.
is there anything wrong??

https://campaign.innovatingautomation.asia/test 

 

0 Upvotes
PamCotton
Community Manager
Community Manager

launching chat from a link

SOLVE

Hello @RZhang could you please provide us more details in what was changed on your end? 

 

Thank you,

Pam

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




RZhang
Member

launching chat from a link

SOLVE

Hi Pam,

I want to realize the effect like that:

When I click a button, the chat box come out in a new tab. Please check the attachment.

https://community.hubspot.com/t5/Tickets-Conversations/launching-chat-from-a-link/td-p/252778


Best Regards

0 Upvotes
soumlabs
Contributor

launching chat from a link

SOLVE

Hey but where do i put this piece of code? I'm no programmer. Also, i see their website they have moved the chat widget to middle of the pages. How to do it?

0 Upvotes
Solution
Anonymous
Not applicable

launching chat from a link

SOLVE

No code required, just "Append #hs-chat-open to the end of your URL to trigger the chat widget launch."

 

Reference: https://knowledge.hubspot.com/articles/kcs_article/conversations/chat-with-your-website-visitors

 

🙂 

CAmmann
Participant

launching chat from a link

SOLVE

That works, however, with the delay set. Does anyone know how the chat window will open immediately?

0 Upvotes
kvlschaefer
Community Manager
Community Manager

launching chat from a link

SOLVE

Hi @CAmmann,

 

Thanks for reaching out! 

 

This thread is 4 years old and may not have full visibility among our Community Members.

 

To ensure that your question is seen by our community members, I would encourage you to create a new post on the Community.

 

Please make sure to include a full description of the issue you are running into or your goal and any pertinent screenshots in the new post for the Community to better assist with the next steps. Thank you! 

 

Best,

Kristen


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes
cquesadad
Solution
Participant

launching chat from a link

SOLVE

Perfect! I understod: here the complete solution that wordked for me:

 

<a id="click-to-chat__cta--text" class="cta cta--blue" style="margin-top: 20px;" onclick="window.HubSpotConversations.widget.open()" href="#hs-chat-open">Chat with Sales</a>
kvlschaefer
Community Manager
Community Manager

launching chat from a link

SOLVE

Thanks for sharing, @cquesadad


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !