Website Embed
Add the chat window to your website with one line of script, plus the page methods and language rules you can use.
In the text below, {API} refers to the service address, which you can find on the Integration page in the dashboard.
<script src="{API}/static/aics-widget.js" data-key="pk_xxx" data-api="{API}" async></script>
data-keyis the public key. Copy it from the Integration page in the dashboard.- On the Integration page, register the websites allowed to embed the widget (for example,
https://shop.example.com). Other websites won't be able to use it even if they get your public key. Be sure to fill this in before going live. - Optionally add
data-theme="dark"to use the dark style. - Optionally add
data-language="de": if your website is multilingual, pass in the current page's language, and the customer service will use that language by default (visitors can still switch). For supported language codes, see the API overview. - Optionally add
data-language="auto": this uses the page's<html lang>as the default language. After that, when the page switches language (by changing thelangattribute — no refresh needed for single-page apps), the customer service window switches automatically too.
You can call the following on the page:
| Method | What it does |
|---|---|
AICS.open() / AICS.close() / AICS.toggle() | Open, close, or toggle the customer service window — for example, on a "Contact support" button |
AICS.identify(userToken) | Tell customer service who the customer is after they log in (see Identify logged-in customers) |
AICS.setLanguage(code) | Call this when your website switches language; the customer service window and subsequent replies follow, e.g. AICS.setLanguage("ja"). Also accepts forms like zh-Hans and pt-BR |
AICS.reset() | Call this when a customer logs out: unloads the customer service window and discards the current session. Loading the script again creates a fresh anonymous window, so the next person can't see the previous person's conversation |
Language
- The customer service window displays the language corresponding to the visitor's location (IP), including interface text and the welcome message. If
data-languageis set, the page language takes priority. If the location can't be determined, the "default language" set in the dashboard is used. - The AI answers in the language the customer uses. If the customer's message doesn't reveal a language (emoji, order number), it uses the language determined above.
- Customers can switch languages from the language menu at the top of the window, or simply tell the AI "Please answer in English." After that, the AI keeps using that language even if the customer writes in another one.
- When your website switches language (
AICS.setLanguage, or changing<html lang>whendata-language="auto"is set), that also counts as the customer's choice. Among these methods, the most recent one wins; the default language included when the page first loads won't override a language the customer has chosen. - In the dashboard under Bot settings → Language, you can turn off IP-based detection, change the default language, and restrict which languages are available.
- If deployed behind a reverse proxy or CDN, you need to configure
TRUSTED_PROXIESorCOUNTRY_HEADERon the server; otherwise the visitor's real IP can't be obtained.
Was this page helpful?
Last updated:
