Skip to main content

Embed Your Agent on Your Website

Add your RightAsk AI agent as a live chat widget on any website by pasting two lines of code before your closing '</body>' tag.

K
Written by Khrystyna Maryniuk

Overview

Embedding your agent places a chat widget directly on your website so visitors can start conversations without leaving your page. The widget connects to your RightAsk agent in real time, uses the configuration you set in RightAsk, and appears on every page where the snippet is installed.

Embedding is available on all plans, including Free. No upgrade is required.

Before You Start

  • You need at least one agent created in RightAsk. If you have not set one up yet, complete Setting Up Your Agent With the Quick Start Wizard first.

  • You need access to your website’s HTML source so you can paste a code snippet before the closing </body> tag.

  • If your site uses a CMS (such as WordPress, Webflow, or Squarespace), check that platform’s documentation for how to add custom HTML to the footer area.

Finding Your Embed Code

  1. In the left sidebar, expand Agents.

  2. Select Configuration.

  3. In the Configuration panel header, select the Embed button (shown with a code icon). The “Embed Your Agent” dialog opens and your personal embed code loads automatically.

The dialog shows your embed code and a short installation guide with the steps: copy the snippet, open your HTML file, paste before </body>, and save.

Adding the Embed Code to Your Website

Your embed code consists of two <script> tags that must both be present. The first sets your agent’s token and API endpoint; the second loads the widget script.

<!-- RightAsk Chatbot Widget -->
<script>
  window.RightAskConfig = {
    embedToken: "YOUR_TOKEN",
    apiBaseUrl: "https://api.rightask.ai"
  };
</script>
<script src="https://widget.rightask.ai/widget.js" defer></script>

YOUR_TOKEN is replaced automatically with your agent’s actual embed token when you open the Embed dialog in RightAsk.

To install the snippet:

  1. In the Embed dialog, select Copy Code. The button label changes to “Copied!” to confirm the copy succeeded.

  2. Open your website’s HTML file in your editor or CMS.

  3. Locate the closing </body> tag near the bottom of the file.

  4. Paste both script tags immediately before </body>.

  5. Save and publish your changes.

Did this answer your question?