TapCub is live — analytics, insights and live chat, free on one platform
Help center

How do I open the chat from my own button?

The three methods, a copy-paste button, and why the method is sometimes missing.

Live chat1 min readLast updated Oct 28, 2026TapCub teamPart of Turn on the chat widget

Short answer

Call tapcub.chat.open() from your button. It exists once the bubble has loaded, so check for it first.

A button that opens chat

Once the bubble is on the page, the launcher adds three methods to window.tapcub.chat: open(), close() and toggle().

index.html
<button type="button" onclick="window.tapcub && tapcub.chat ? tapcub.chat.open() : location.href = 'https://chat.askcub.com/YOUR_SITE_KEY'">
  Chat with us
</button>

The fallback opens the standalone chat page when the bubble is not available, so the button always does something.

When tapcub.chat is missing

  • Chat is switched off, or the page has data-chat="false".
  • Hide bubble on mobile is on and the visitor is on a phone or a narrow window.
  • The launcher has not finished loading yet. It loads after the first pageview, so a click in the first moment after page load can come too early.

Did this answer your question?

We use your answers to fix and expand this page.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics