Open Widget With Link

How to open the chat widget by clicking a link

You can make the Octocom chat widget appear when a customer clicks a link on your site. There are two simple options:


Option 1: Query parameter

Add ?open-octocom to the URL:

<a href="/?open-octocom">Chat with us</a>

When the page loads with this query parameter, the chat widget will automatically open.


Option 2: Hash parameter

Add #open-octocom to the URL:

<a href="/#open-octocom">Chat with us</a>

The benefit of using a hash parameter is that if the user is already on the same page, clicking the link will not trigger a full page reload. However, not all systems support adding or parsing hash parameters.


You don’t always need to include the full URL. If you only include the query or hash parameter in the href, the browser will apply it to the current page.

For example, from anywhere on your site:

<!-- Opens widget with a page reload -->
<a href="?open-octocom">Chat with us</a>

<!-- Opens widget without reloading if already on same page -->
<a href="#open-octocom">Chat with us</a>

This is especially useful for footers or shared UI elements, where the URL path may change depending on the page.


Important note

This method only works with links (<a>). If you want to use an HTML button or any other element, you’ll need JavaScript instead. You can find the relevant guide here.


✅ Use either method depending on your site setup and desired behavior.

Last updated