> ## Documentation Index
> Fetch the complete documentation index at: https://help.avoca.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Web Chat

> Turn on the chat widget for your website, choose how it behaves, and add it to your site.

Web Chat puts an Avoca chat assistant on your website. Open **Products → Web Chat** to turn it on, choose how it behaves, and copy the code that adds it to your site.

**1. Turn on website chat**

On the **Website Widget** tab, switch on **Website chat**.

**2. Choose the color and country**

Set **Widget theme color** as a six-digit hex code, such as `#3B8AFF`. Pick your **Country** from **Not set**, `US`, `CA` or `AU`.

Switch on **Infer country from website domain** if your site uses a `.ca`, `.co.uk` or `.com.au` address. When it is on, that address overrides **Country** for postal-code wording and for reading phone numbers entered before the chat. Leave it off to always use **Country**.

**3. Check the service area**

Switch on **Validate service area** to check each visitor's ZIP code against the areas you serve. When a ZIP code is not supported, the chat shows the text from **Invalid service area message** and ends. If you leave that field empty, Avoca uses a default message.

**4. Choose how appointment times work**

Switch on **Enable schedule negotiation** to let the widget negotiate available appointment times with the visitor.

Two more switches sit under **ServiceTitan**. **Use booking windows availability** offers times from your booking windows. **Create jobs with schedule windows** creates the job with an arrival window.

**5. Choose who is notified**

Under **Notifications**, switch on **Send emails** and list the addresses in **Email recipients**, separated by commas or new lines. Switch on **Create ServiceTitan jobs** if chats should create jobs in ServiceTitan.

**6. Save**

Select **Save**. The button reads **Saved** when everything is up to date.

**7. Add the widget to your website**

In the **Install widget** card, copy the code and add it to your site before the closing `body` tag.

> [!WARNING]
>
> Turning on **Website chat** does not put the widget on your website. The widget appears only after the code from **Install widget** is on your pages.

## Track chat activity

Your website widget pushes events to your page's `dataLayer`, so a tag manager on the same page can count chats and conversions. Nothing changes in your widget code.

There are two kinds of events.

Chat activity events: these all come in as one event called `avoca_webchat`. What happened is stored in a value called `avoca_event_name`.

| `avoca_event_name` | When it's sent |
| - | - |
| `chat_started` | Someone opens the chat window. Use this one to count opens. |
| `widget_opened` | Someone opens the chat. |
| `widget_closed` | Someone closes the chat with the chat button |
| `widget_minimized` | Someone closes the chat from inside the chat window |

Each one also carries `avoca_session_id`, which stays the same during one browsing session. When the page address has them, each one also carries the visit's UTM values and ad click IDs: `avoca_utm_source`, `avoca_utm_medium`, `avoca_utm_campaign`, `avoca_utm_content`, `avoca_utm_term`, `avoca_gclid`, `avoca_wbraid` and `avoca_gbraid`.

Conversion events: each of these is its own event, sent at most once per conversation, even if the visitor reloads the page. Each one carries `conversation_id`.

| Event | When it's sent |
| - | - |
| `inbx_web_chat_start_chat` | A conversation starts |
| `inbx_web_chat_lead_captured` | The visitor shares a phone number or email |
| `inbx_web_chat_clicked_appointment_time` | The visitor picks an appointment time, or books one |
| `inbx_web_chat_booking_confirmed` | An appointment is booked. Sent only by the widget version that has the **Agent**, **Objective**, **Testing** and **Setup** tabs. |

On the widget version with **Agent**, **Objective**, **Testing** and **Setup** tabs, conversions are sent only when **Enable INBX Conversion Metrics** is on under **Setup**.

> [accordion] I don't see some events
>
> * Chat activity events are sent only when the page already has a `dataLayer`. Check that your tag manager is installed on the same page as the widget.
> * If you don't see conversion events and your page has **Agent**, **Objective**, **Testing** and **Setup** tabs, check that **Enable INBX Conversion Metrics** is on under **Setup**. If your page has a **Website Widget** tab instead, ask your Avoca team to check that conversion tracking is turned on.

> [accordion] Change the launcher text or open the chat automatically
>
> The **Optional widget settings** card shows lines you can add to your page. They set the launcher message, the welcome screen title, whether a welcome screen opens automatically when the page loads, and whether the chat opens straight away. Copy the card, then keep only the lines you want.

> [accordion] My Web Chat page has Agent, Objective, Testing and Setup tabs
>
> Some teams see this version of the page instead. Select **Save** at the top to save changes on the **Agent** tab.
>
> * **Agent** has the cards **Identity**, **Pre-chat form**, **Greeting & quick starts**, **In-chat widgets**, **Styling** and **Embed placement**.
>
> * **Objective** is where you write what your web chat agent should do. It saves on its own with **Save objective**, not with the page's **Save**.
>
> * **Testing** lets you try the widget in a sample website frame. **Preview appearance** shows your unsaved appearance changes with scripted replies. **Test AI** uses your saved settings and skips availability lookups, bookings and customer updates. **Live test** uses real availability and can create bookings, update customers and send notifications. Save your changes before you test.
>
> * **Setup** has the **Enable webchat** switch and the **Web Chat Integration Instructions**. Copy the key script first, then the widget script tag, which goes right before the closing `body` tag. When **Enable webchat** is off, the widget does not load.
>
> > [!WARNING]
> >
> > **Live test** conversations are real customer conversations. Resetting or leaving does not undo bookings, customer updates or notifications.
>
> To show the chat inside a section of your page, turn on **Inline hero embed** under **Agent → Embed placement** and select **Save**. Then open **Setup** and find **Inline hero embed**. Add an element where the chat should appear, using the **Container ID** shown there:
>
> ```html theme={null}
> <div id="avoca-chat-inline"></div>
> ```
>
> Then add this line inside the key script, using the same ID:
>
> ```js theme={null}
> window.ChatWidgetInlineTarget = '#avoca-chat-inline';
> ```
>
> The inline chat fills its container, so size and position it with your own page styles. It runs alongside the floating widget and shares the same settings.

> [accordion] I don't see Web Chat
>
> Web Chat appears only for teams that have it turned on, and only for people whose role includes access to it. Ask a team admin to check your access.
