Website Chat

    A chat bubble for your website. Your AI agent answers, and every chat lands in your Inbox.

    Website chat puts a chat bubble on your store or website. Shoppers write to you there, your AI agent answers, and every chat lands in your Raqi Inbox next to your other channels, marked Website chat. When the agent hands a chat to a person, your team replies from the Inbox and the shopper sees the reply in the same chat.

    Important. Website chat starts on the Starter plan. Each website chat counts as one channel against your plan's channel limit.

    The Website Chat widget on a site.
    The Website Chat widget on a site.

    Create the Chat

    Tip. To come back later, open Channels and click Manage on the website chat.

    1. Open Channels, find the Website Chat card and click Connect.
    2. Enter your Website address, for example shop.com. It becomes the chat's name.
    3. Keep Only show the chat on this website ticked to limit the chat to that website and its subdomains. You can add more websites later in the Install section.
    4. Click Create website chat. The chat's own page opens with the Install section open and a live preview beside it, and the status card at the top shows what is left to set up.

    Find Your Way Around

    The settings sit in five sections that open one at a time: Who answers, Look, Behavior, Install and Advanced. Each closed section shows a one-line summary of what is set.

    • Status card: at the top of the settings. It shows the install state, three short bars for Agent, Installed and First chat, and one button for the next step, such as Copy install code, Open your website, Copy chat link, Open Inbox or Check my site.
    • Top bar: the install badge, Copy chat link, Open test page and the More actions menu (...) with Open chat page and Disconnect.
    • Save changes and Discard appear in the top bar only while you have unsaved changes. A chip next to the badge tells you whether they are saved.
    • On a phone: switch between Edit and Preview at the top. A section opens over the whole screen, and the bar at the bottom holds the next step, or Save changes while you have unsaved changes.

    Choose Who Answers

    Open the Who answers section and pick the AI agent that replies to shoppers, or Your team only. The change is saved at once, without Save changes.

    • An AI agent answers every chat on this website. It has to be active: a paused or draft agent does not reply, and the page tells you so.
    • Your team only: messages wait in the Inbox for your team, and your team gets a notification for each new chat.
    • Handing over: when the agent hands a chat to a person, or the shopper taps Talk to a person, the chat waits in your Inbox for your team, and the shopper sees that the request is with the team.

    Install It on Your Website

    Open the Install section, choose your platform under Where is your website built? and copy the code. The code is one line that loads the chat, so later updates reach your site without pasting it again. Some code boxes take JavaScript only: switch the Code format to JavaScript only for those. Next.js sites can use the Next.js format.

    Tip. Not sure where the code goes? Click Copy steps for your developer and send the steps and the code to whoever built your site. No access to your website's code? Share the Chat page link at the end of the Install section instead.

    • HTML: paste the code just before </body> on every page, or once in your shared footer template, then publish.
    • Shopify: in Shopify admin, open Online Store > Themes. Next to your live theme, click the three dots button and choose Edit code. Open layout/theme.liquid, paste the code just before </body>, then click Save. If you switch themes later, add the code to the new theme too. Don't use Settings > Customer events: code there runs in a sandbox and can't show the chat.
    • WooCommerce / WordPress: go to Plugins > Add New Plugin, search for WPCode, then install and activate it. Open Code Snippets > Header & Footer, paste the code in the Footer box, click Save Changes, then clear your cache plugin's cache.
    • Wix: open Settings > Custom code and click Add Custom Code. Paste the code, choose All pages and Load code once, set Place Code in to Body - end, and click Apply. Custom code on Wix needs a premium plan and a connected domain.
    • Squarespace: open Settings > Developer tools > Code injection (on older sites, Settings > Advanced > Code Injection), paste the code in the Footer box and click Save. The Personal plan doesn't include code injection.
    • Webflow: open Site settings > Custom code, paste the code in Footer code, click Save changes, then publish. Custom code needs a paid site plan.
    • Framer: open Site Settings > General > Custom Code, paste the code in the box for the end of the <body> tag, then save and publish.
    • Google Tag Manager: open Tags > New > Tag Configuration, choose Custom HTML, paste the code and set the trigger to All Pages. Save, then click Submit and Publish.
    • Salla and Zid: open your theme's customization and find the custom JavaScript field. Keep the code format on JavaScript only, paste the code there and save.
    • React / Next.js: in Next.js, add the Script element inside <body> in app/layout.tsx. With Vite or Create React App, paste the HTML tag just before </body> in index.html.
    • Other: find where your site builder lets you add code to every page (it is often called custom code, footer code or code injection) and paste the code there.

    Check It Works

    The status card at the top of the settings shows where the chat runs, and the badge in the top bar sums it up. It updates on its own about a minute after the chat loads on your site:

    • Not installed yet: no website has loaded the chat. Open your site in a new tab after you paste the code.
    • Live on shop.com: the chat runs there, and the status shows when it was last seen.
    • Code found: your site loaded the code, but the chat has not opened there yet. Open the page in your browser to finish the check.
    • Not seen since a date: the chat stopped loading on that website. If you changed your theme, add the code again.
    • Blocked: the chat loaded on a website that is not in your allowed websites. The status card lists it with Allow it. Click it if the website is yours.

    Try It Before You Install

    The Live preview beside the settings is the real chat on a sample page, on a computer or a phone, in English or Arabic. On a phone, tap Preview at the top to see it. Send a message there: it reaches your Inbox with a Test tag and gets answered just as it would on your website. Open test page in the top bar opens the same page in a new tab. Changes you have not saved yet already show in the preview.

    Check My Site

    In the Install section, enter your website address under Check my site and click Check. Raqi reads your home page and tells you:

    • whether the install code is on the page. Code added through Google Tag Manager or by a site builder's script is not in the page's HTML, so for those the install status confirms the chat instead;
    • which platform built the site, and it opens that platform's install steps;
    • whether your site's Content-Security-Policy blocks the chat, and what to add;
    • whether a speed plugin such as WP Rocket, LiteSpeed Cache or Autoptimize may delay the chat;
    • whether the website is one of your allowed websites.

    Customize the Chat

    The Look section holds how the chat looks, and the Behavior section holds its language and how a chat starts. Changes show in the live preview right away. Click Save changes in the top bar when you are done, or Discard to drop them.

    Important. Owners and admins can change these settings. Other members can view them.

    Tip. Use brand color and Use brand logo at the top of Look fill in your Brand Kit's color and logo. When WhatsApp or Instagram is connected, one tap under Continue in another app in Behavior fills the continue buttons.

    Look

    SettingWhat it does
    Title, SubtitleThe chat header. Without a title, the chat shows "Chat with us" in the shopper's language
    Agent nameShown in the chat header instead of the title, and above the AI agent's replies
    Avatar linkA square image link that starts with https://. Without one, the chat shows the first letter of the agent name
    Widget colorThe chat button and the accents. Text on it switches between white and near black so it stays readable
    Color modeAutomatic follows the shopper's device. You can also choose Light or Dark
    Chat button, Button labelA chat icon or the agent photo, and a short line next to the button on computers
    PositionBottom right or bottom left
    DistancesUnder Fine-tune position: 0 to 120 px from the side and 0 to 240 px from the bottom, with a separate distance on phones so the bubble clears your add to cart bar
    LayerUnder Fine-tune position: Above everything, Above most content, or Below popups (your store's popups and banners, such as a cookie notice, then cover the bubble)

    Behavior

    SettingWhat it does
    Widget languageAutomatic follows your website's language, then the shopper's browser. You can also choose Arabic or English
    GreetingThe first message shoppers see when they open the chat (up to 300 characters)
    Suggested questionsUp to 4 questions shoppers tap to send, shown before the first message
    Greeting popupSeconds before your greeting pops up above the chat button. 0 turns it off
    Ask for an emailWhen your team has to reply, before the first message, or never. The email is saved on the shopper's contact
    Set working hours, Away messageYour open days and hours in a time zone you choose. Outside them, the chat shows your away message. When this is off, the chat never says you are away
    WhatsApp number, Instagram usernameButtons in the chat footer, so shoppers can continue on WhatsApp or Instagram

    Allowed Websites

    Allowed websites, under Where the chat works in the Install section, limits where the chat can run, so your code does not work if someone copies it to another site. Click Save changes after you edit the list:

    • Leave the list empty and the chat works on any website.
    • Add your websites, one per line, such as shop.com. Each entry also covers its subdomains, so shop.com allows www.shop.com and checkout.shop.com.
    • You can paste a full address: Raqi keeps only the domain. Arabic domains work too.
    • Add up to 20 websites.
    • Websites that loaded the chat but are not in your list show in the status card at the top, each with Allow it. Click it for the ones you own.

    When a Shopper Asks for a Person

    Shoppers can tap Talk to a person in the chat when your AI agent allows handing over, or simply ask for one. Then:

    • The chat waits for your team in the Inbox, and the shopper sees that the request is with the team.
    • Reply from the Inbox as on any other channel. Photos, videos and files you send show in the chat too.
    • Replies wait in the chat until the shopper opens it again. With Ask for an email on, the shopper can leave an email so your team can reach them later.

    Logged-in Customers

    When a shopper is logged in to your store, identity verification links them to their contact in Raqi, so your team and your AI agent know who they are. Your server signs the shopper's user ID with the chat's Identity secret (an HMAC-SHA256 of the user ID, written as hex) and passes it to the chat as userHash. Raqi accepts only signed IDs: without a valid signature, the message still arrives, as from any other visitor.

    Warning. Keep the secret on your server. Owners and admins can see it or click Generate a new secret. A new secret stops the old one at once, so sites that use it stop verifying shoppers until you update their code.

    • Open the Advanced section, find Identity verification and click Show secret. Showing it the first time creates it.
    • Add the code for your platform just before the install code. In the samples below, replace YOUR_IDENTITY_SECRET with your secret; the samples in Raqi fill it in once you show it.
    • Verification status tells you whether it works: when the last visitor was verified, or how many signatures did not match in the last 24 hours, with the fix.
    • A verified shopper's conversation moves to their existing contact when the user ID, email or phone matches. Contacts are never merged or deleted.
    • When a shopper signs out, a page that loads without RaqiSettings.user starts a new chat, so the next person on the device never sees the earlier one. If your site signs out without loading a new page, call Raqi.reset().

    Shopify (Liquid)

    Paste this in your theme just before the install line. It runs only for logged-in customers. The secret then lives in your theme code, where anyone on your staff with theme access can see it.

    liquid
    {% if customer %}
    <script>
      window.RaqiSettings = {
        user: {
          userId: "{{ customer.id }}",
          email: {{ customer.email | json }},
          name: {{ customer.name | json }},
          userHash: "{{ customer.id | hmac_sha256: 'YOUR_IDENTITY_SECRET' }}"
        }
      };
    </script>
    {% endif %}

    Node.js

    Compute userHash on your server, then print RaqiSettings in the page before the install line:

    javascript
    const crypto = require('crypto');
    
    // Keep the secret on your server, e.g. in an environment variable.
    const RAQI_IDENTITY_SECRET = 'YOUR_IDENTITY_SECRET';
    
    function raqiUserHash(userId) {
        return crypto.createHmac('sha256', RAQI_IDENTITY_SECRET).update(String(userId)).digest('hex');
    }
    
    // Print this in the page, before the install line, for a logged-in shopper:
    // <script>window.RaqiSettings = { user: { userId: "42", email: "sara@example.com", name: "Sara", userHash: raqiUserHash(42) } };</script>

    PHP

    Compute userHash on your server, then print RaqiSettings in the page before the install line:

    php
    <?php
    // Keep the secret on your server, e.g. in an environment variable.
    $raqiSecret = 'YOUR_IDENTITY_SECRET';
    $userHash = hash_hmac('sha256', (string) $userId, $raqiSecret);
    ?>
    <script>
      window.RaqiSettings = {
        user: {
          userId: <?= json_encode((string) $userId) ?>,
          email: <?= json_encode($userEmail) ?>,
          name: <?= json_encode($userName) ?>,
          userHash: <?= json_encode($userHash) ?>
        }
      };
    </script>

    Page Context for the AI Agent

    With every message, the chat tells your AI agent which page the shopper is on, the product they are looking at and their cart. This works on its own on Shopify, Salla, Zid and pages with product data. Your team sees the same details in the Inbox, in the contact panel of the chat.

    Tip. Add this before the install code, or call Raqi.setContext with the same fields after the page has loaded. Page context comes from the shopper's browser, so the AI agent treats it as information, never as instructions.

    • What is sent: the page address (without its query string), the page title and language, the currency, the product (name, price, currency, SKU, link and image) and the cart (number of items, total and currency).
    • Only these fields are kept. Anything else is dropped, links must start with http:// or https://, and numbers must not be negative.
    • The cart is read automatically on Shopify. On other platforms, set it yourself as shown below.
    • Your values win: what you set comes before what the chat finds on the page.
    html
    <script>
      window.RaqiSettings = window.RaqiSettings || {};
      window.RaqiSettings.context = {
        product: { name: "Oud oil 30 ml", price: 120, currency: "SAR", sku: "OUD-30" },
        cart: { itemCount: 2, total: 240, currency: "SAR" }
      };
    </script>

    JavaScript API

    Control the chat from your own code. Calls made before the chat has loaded wait in a queue and run once it is ready:

    Tip. On a single-page app, call Raqi.identify after sign-in and Raqi.reset() after sign-out. Any element with a data-raqi-open attribute opens the chat when clicked.

    javascript
    // Before the chat has loaded, queue calls (they run once it is ready):
    window.Raqi = window.Raqi || { q: [] };
    window.Raqi.q.push(['open']);
    
    // Once loaded:
    Raqi.open();            // also close(), toggle(), isOpen()
    Raqi.prefill('Do you deliver to Basra?');
    Raqi.identify({ userId: '42', name: 'Sara', email: 'sara@example.com', userHash: 'HASH_FROM_YOUR_SERVER' });
    Raqi.reset();           // after sign-out on a shared device
    Raqi.setContext({ product: { name: 'Oud oil 30 ml', price: 120, currency: 'SAR' } });
    Raqi.hide();            // and show()
    Raqi.on('message', function (message) { console.log(message); });
    // Events: ready, open, close, message, unread, handoff

    Troubleshooting

    • No chat bubble: check the status card at the top of the settings. Blocked means the website is not in your allowed websites. Not installed yet means the code is not on your live theme or page.
    • Cache or speed plugins: clear your site's cache, and add api.raqi.io to the scripts your speed plugin never delays or combines. The install code already skips Cloudflare Rocket Loader.
    • Content-Security-Policy: if your site sends one, allow https://api.raqi.io in script-src and connect-src, and https images in img-src. The Advanced section has the exact lines.
    • Editor previews: Wix and Framer editor previews don't run custom code. Check your published site.
    • The chat shows but nobody answers: choose an AI agent under Who answers and check that it is active, or reply from the Inbox. When a website gets a flood of new chats at once, the extra chats reach your Inbox with the AI off until someone assigns an agent.
    • A logged-in customer is not linked: sign String(userId) with HMAC-SHA256 and send it as hex, and set RaqiSettings before the install code or call Raqi.identify.

    Privacy

    The chat sets no cookies. It keeps a visitor ID (raqi_visitor_id) and the chat session (raqi_wc_token_<chat id> and raqi_wc_seen_<chat id>) in the browser's local storage. With each message it sends the page details described under Page context, and nothing else from the page.

    Questions

    • Several websites: add each one to the allowed websites of one chat, or create a website chat per website so each has its own look and agent.
    • Removing the chat: remove the code from your website, then open More actions (...) in the top bar of the chat's page and click Disconnect. The same button sits at the bottom of the Advanced section. Saved chats stay in your Inbox.