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
soumlabs
Contributor

launching chat from a link

SOLVE

That is not the solution. It will refresh the page upon clicking the hyper link. I don't want the page to refresh.

0 Upvotes
Anonymous
Not applicable

launching chat from a link

SOLVE

Then it would help to specify your requirments in more detail 

0 Upvotes
soumlabs
Contributor

launching chat from a link

SOLVE

I just want it to work like it is working in the website of the originial poster of this thread. Click the hyperlink and the chat opens up without refreshing the page.

 

Go to the footer of this website and click the live chat hyperlink text

 

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

0 Upvotes
MFrankJohnson
Thought Leader

launching chat from a link

SOLVE

- see Chat with your website visitors regarding use of #hs-chat-open

- see original solution above (also, image below)

 

hubspot-chat-code-onclick-click-to-open.png

 

 

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
0 Upvotes
Anonymous
Not applicable

launching chat from a link

SOLVE

@MFrankJohnson  Please stick to DRY principles. Not sure why you'd want to add JS when a simple anchor link works and is the suggested solution as per the Hubspot documentation - link above

0 Upvotes
MFrankJohnson
Thought Leader

launching chat from a link

SOLVE

>>"MFrankJohnson Please stick to DRY principles. Not sure why you'd want to add JS when a simple anchor link works and is the suggested solution as per the Hubspot documentation..."

 

WOW, Lopser. Appreciate the flogging.


However, one of the reasons the HubSpot Community exists is because HubSpot documented/suggested solutions don't always solve for all use cases.


-ps
The HubSpot Community is a place where EVERYONE is welcome to post their solutions without being patronized or condescended to. BTW - DRY development speaks to reduction in reduncancy and code repetition specifically -- not the use of alternative solutions or .js.

#nlmtu

 

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
Anonymous
Not applicable

launching chat from a link

SOLVE

@MFrankJohnson I'm not saying your solution isn't correct, I'm saying that you are recreating the wheel when it's not neccessary - there's a simpler way to implement.

 

A couple of extra characters or requests here and some more there all adds up and will impact your website performance.

 

Re: my previous reply, you are right, everyone is welcome to post. I apologise, sometimes my OCD gets the better of me.

 

Best of luck

soumlabs
Contributor

launching chat from a link

SOLVE

The anchor redirected the page to a 404 and then it opened the chat. 

0 Upvotes
soumlabs
Contributor

launching chat from a link

SOLVE

@MFrankJohnson I couldn't try your method as I don't know where to put code. Explain?

0 Upvotes
Anonymous
Not applicable

launching chat from a link

SOLVE

@soumlabs  If you want the button/link to open the chat bubble without a page refresh/reload, then don't use the full page link, and just link to the anchor instead.

 

here you go:

 

<a href="#hs-chat-open">Open chat</a>

 

Did my post help your query? Help the community by Marking it as a solution if it solved your query. In addition, Upvotes are welcome too.

0 Upvotes
soumlabs
Contributor

launching chat from a link

SOLVE

It was worse than refreshing page. When I clicked the hyperlink, it took my off to a different 404 not found page and then it opened the chat window.

@Anonymous 

0 Upvotes
zogics
Participant

launching chat from a link

SOLVE

You are a "super-genius" - yes it works. Thank you thank yoy!

0 Upvotes
MFrankJohnson
Thought Leader

launching chat from a link

SOLVE

No genious. Just resourceful HubSpot researcher.

Please mark as solved. Thanks

 

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
0 Upvotes