Copilot is an AI chat assistant for your website. It answers visitors questions about your listings, searches your properties, explains how buying and renting work, collects contact details from interested visitors and emails your team a transcript of every conversation.
This article explains how to add the widget to your website and every configuration option. For controlling the chat from your own code, see Copilot JavaScript API and events. For what happens during and after a conversation, see How Copilot conversations work.
Installation
Add the following code to every page where the chat should appear, just before the closing </body> tag. Replace YOUR_WIDGET_TOKEN with the token you received from Estatebud.
<script>
window.EstatebudCopilot = {
token: 'YOUR_WIDGET_TOKEN'
};
</script>
<script src="https://dev-widget.estatebud.com/embed.js" async></script>
The configuration object must be defined before embed.js loads. The script only creates the widget once per page, so including it twice does no harm.
Allowed domains
For security, the widget only loads on websites that have been registered for your token. Send Estatebud every hostname the widget should run on, for example example.com and www.example.com: hostnames only, without https:// or a path. If a domain is missing, the widget does not appear and the browser console shows:
[Copilot] Invalid domain: "www.example.com". Your domain name must be added to the list of allowed domains.
Single-page websites
Websites that change pages without a full reload (React, Vue, Next.js and similar) are supported automatically. The widget follows pushState, replaceState and the browser's back and forward buttons, so it always knows which page the visitor is on.
Configuration options
All options go in the window.EstatebudCopilot object.
| Option | Type | Default | Description |
|---|---|---|---|
token |
string | required | Your widget token. Without it the widget does not load. |
position |
string | bottom_right |
Where the chat button appears: bottom_right or bottom_left (with an underscore). |
locale |
string | visitor's browser language | Forces the interface language, e.g. 'el'. See Languages. |
i18n |
object | none | Replaces selected interface texts. See Translation overrides. |
inviteMessage |
object | none | Shows a greeting bubble next to the chat button. See Invite message. |
Full example
<script>
window.EstatebudCopilot = {
token: 'YOUR_WIDGET_TOKEN',
position: 'bottom_left',
locale: 'en',
i18n: {
home_title: 'Welcome to Sunshine Estates! 👋',
home_text: 'Ask us anything about our properties.'
},
inviteMessage: {
text: '👋 Hi! Looking for a home in Paphos? I can help.',
delay: 5000
}
};
</script>
<script src="https://dev-widget.estatebud.com/embed.js" async></script>
Invite message
An invite message is a short greeting that pops up next to the chat button to start a conversation. It is shown only when the visitor has no open conversation and the chat is closed. When the visitor opens the chat, the invite appears as the first message from the assistant.
| Field | Type | Description |
|---|---|---|
text |
string | The greeting. Leave it empty to show no invite. |
delay |
number | How long to wait before showing it, in milliseconds (5000 = 5 seconds). Default 0. |
You can also show an invite later from your own code, for example on a specific page or after the visitor scrolls. See the inviteMessage command in Copilot JavaScript API and events.
Languages and translation overrides
Interface languages
The widget interface (buttons, labels, placeholders and disclaimers) is available in 14 languages:
| Code | Language | Code | Language |
|---|---|---|---|
bg |
Bulgarian | it |
Italian |
da |
Danish | nb |
Norwegian |
de |
German | nl |
Dutch |
el |
Greek | pl |
Polish |
en |
English | ro |
Romanian |
es |
Spanish | ru |
Russian |
fr |
French | sv |
Swedish |
How the interface language is chosen:
-
The
localeoption, if it is set to one of the codes above. -
Otherwise the visitor's browser language, if it is one of the codes above.
-
Otherwise English.
The conversation itself is not limited to these languages. The assistant always replies in the language the visitor writes in, whatever the interface language is.
Translation overrides
You can replace these interface texts with your own wording through the i18n option. Overrides apply in every language, so if your site has several languages, set them per page language.
| Key | Where it appears | Default (English) |
|---|---|---|
home_title |
Heading on the chat's start screen | Hello! 👋 |
home_text |
Text under the heading on the start screen | How can we help you? |
Other keys are ignored. Example for a multilingual site:
<script>
var lang = document.documentElement.lang || 'en';
window.EstatebudCopilot = {
token: 'YOUR_WIDGET_TOKEN',
locale: lang,
i18n: lang === 'el'
? { home_title: 'Καλώς ήρθατε! 👋', home_text: 'Πώς μπορούμε να σας βοηθήσουμε;' }
: { home_title: 'Welcome! 👋', home_text: 'How can we help you today?' }
};
</script>
Widget settings
These settings are stored with your widget by Estatebud, not in the embed code. Contact Estatebud to change them.
| Setting | Description |
|---|---|
| Assistant name | The name the assistant uses for itself and shows on its messages, e.g. "Sophia". |
| Brand color | Main color of the chat button and header, as a hex color (e.g. #5c73e5). |
| Text color on brand color | auto (chosen for best contrast), light or dark. |
| Logo | Your logo, shown in the chat header. |
| Avatar | Image shown next to the assistant's messages. |
| Approach | How actively the assistant asks for contact details. See below. |
| Time zone | The time zone used for times in transcript emails. |
| Allowed domains | The hostnames the widget may load on (see Installation). |
| Transcript recipients | The email addresses that receive transcripts (To, Cc or Bcc). |
Approach
| Approach | Behavior |
|---|---|
| Relaxed | Just helps. Never asks for contact details on its own; only collects them when the visitor offers them or asks to be contacted or to book a viewing. |
| Balanced (default) | Answers the question first and in full, then invites the visitor once, to share their name. Collects email or phone when the visitor wants a callback, a viewing or a follow-up. |
| Persistent | Asks for name and email or phone before handling requests such as viewings, listing questions or searches, then continues with the request straight away. |
Troubleshooting
| Problem | Solution |
|---|---|
| The chat button does not appear. | Check that window.EstatebudCopilot with your token is defined before embed.js, and look in the browser console for "Invalid domain". |
| The chat button is on the wrong side. | Use bottom_left with an underscore. Any other value, including bottom-left, puts the button on the right. |
| The interface is in the wrong language. | Set the locale option to the page language. It must be one of the 14 supported codes. |
My i18n text is not shown. |
Only home_title and home_text can be overridden. |
| The invite message does not appear. | It is only shown when the visitor has no open conversation and the chat is closed. Check that text is not empty, and remember that delay is in milliseconds. |