Adding a Custom Open Chat Button
Create a custom button that opens your AI Sales Agent when clicked, anywhere on your website.
Updated:
In addition to the standard floating chat launcher, you can create a custom button that opens your AI Sales Agent when clicked. You choose the text, the button takes its colors and shape from your theme, and Yasan gives you a short HTML element you can paste anywhere on your website — for example as a call-to-action on a product page, in your FAQ section, or on a banner.
A great use case is your Contact page: placing an “Ask us” button there nudges visitors toward getting an instant answer from the AI first, instead of jumping straight to a contact form. This is especially useful for winning back visitors who have had bad experiences with other, less helpful chatbots in the past — a custom button gives them a low-friction way to give AI Sales Agent a try right where it matters.
Creating the Button#
Open bot settings
In the left menu, click AI Sales Agents and select your bot.
Open the Chat button section
In the bot settings navigation, open Elements in the Chatbot group.
Enter the button text
Fill in the Button text field (defaults to “Ask us”).
Check the preview
The Preview shows the real button in your theme. To change its colors and shape, follow the link below it to the theme; with advanced colors on, Buttons on your site sets the colors of this button alone.
Copy the script
Click Copy script to copy the generated code to your clipboard. It looks like
<yasan-chat-button>Ask us</yasan-chat-button>.
Installing the Button#
- Shopify: In the theme editor, add a Custom Liquid section where the button should appear and paste the script into it. If your theme has no Custom Liquid section, go to Online Store > Themes, choose Edit code, open
theme.liquidin the Layout folder and paste the script before the closing</body>tag. The button then shows on every page that uses this layout, unless the chat is hidden there. - WordPress and WooCommerce: Add a Custom HTML block to the page and paste the script into it. With the Yasan plugin 1.2.2 or later, anyone who can edit the page can save the block. On older versions, saving it needs the
unfiltered_htmlpermission, which administrators have; without it, WordPress removes the button tag on save. Update the plugin, or ask an administrator to add the code. - Shoptet: The script can be pasted on any page in Shoptet. Open the page in the Shoptet editor, click “Show source code”, and paste the script there.
- Other platforms: Paste the script anywhere in the HTML of the pages where you want the button to appear. The chat widget’s installation script must already be installed on that page — the button itself does not load the widget.
Important behavior to know#
- If you leave the Button text field empty, no script is generated and there’s nothing to copy.
- Extra spaces at the start or end of the button text are trimmed automatically when the code is generated.
- The pasted button follows your theme: a change of colors or shape in the dashboard restyles every button on your site, with nothing to copy again. Only the text lives in the pasted code, so edit it there.
- You can paste the button in as many places on your website as you like — it’s simply a piece of HTML you add yourself, not a single fixed placement.
- The button hides itself where the chat cannot open: while the chatbot is switched off, on pages where you hide it, and on domains the storefront does not allow.
- Buttons you pasted before this element existed keep working, but they keep the color they were generated with.
- This button is an additional entry point to the chat — it does not replace the floating chat launcher.