> ## Documentation Index
> Fetch the complete documentation index at: https://www.voiceflow.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Add the Voiceflow widget to Hostinger

> Add a Voiceflow AI agent to Hostinger Website Builder with the supplied chat widget. Install a DOM-ready snippet, test a visitor conversation and update your site.

## Overview

Add Voiceflow’s floating chat widget to **Hostinger Website Builder** so visitors can ask your AI agent about your products, policies or services. Use the builder’s **manual mode** to add the site-wide script under **Integrations → Custom code**.

Using Hostinger to host WordPress? Follow the [WordPress widget guide](/docs/guides/channels/web/wordpress) instead.

**Note:** 

**Building your own interface?** Custom chat and voice walkthroughs are [coming soon](#custom-interface). Start with [Chat agents](/docs/api-reference/agent-runtime/chat) or [Voice agents](/docs/api-reference/agent-runtime/voice) for the APIs.

New to Voiceflow? [Build a support agent](/docs/guides/usecases/customer-service/build-faq-agent), add your help content to Knowledge and publish it first. This installation provides public support without customer-account access.

<a id="before-you-begin"></a>

## Before you begin

Prepare the published agent and access to the builder’s global custom code.

| Requirement | What to prepare |
| --- | --- |
| Voiceflow agent | A published agent, its complete **Widget → Installation** snippet and a known-answer question. |
| Hostinger site | A published Website Builder site with **More (⋯) → Integrations → Custom code** available. |
| Site administrator | Someone who can save the integration and update the published website. |
| Test destination | A separate test site if you need to review without changing production. |

In Voiceflow, open **Widget → Modality & interface**. Set **Modality** to **Chat** and **Chat interface** to **Widget**, then publish. If widget domains are restricted, have the owner review the test and production hosts.

Hostinger’s [custom-code instructions](https://www.hostinger.com/support/6445594-hostinger-ai-builder-manual-mode-how-to-integrate-custom-code/) cover this builder surface. If a teammate manages the site, send them the generated snippet and the wrapper instructions below. Keep personal and service API keys out of browser code.

<a id="install-widget"></a>

## Install the widget

Wait for the page body before loading the floating widget.

### 1. Copy the generated snippet

In [Agent studio](https://creator.voiceflow.com), open **Widget → Installation** and copy the complete snippet. For the wrapper below, take only the JavaScript **between** its opening `<script ...>` and closing `</script>` tags. Keep that JavaScript unchanged, including authorization, runtime and environment settings.

### 2. Wrap it for head placement

Hostinger puts global Custom code in the page head. Replace the comment in this wrapper with the generated JavaScript body you just copied:

```html
<script>
  (() => {
    const install = () => {
      if (window.__vfHostingerInstalled) return;
      window.__vfHostingerInstalled = true;

      /* PASTE_GENERATED_SCRIPT_BODY_HERE */
    };

    if (document.readyState === 'loading') {
      document.addEventListener('DOMContentLoaded', install, { once: true });
    } else {
      install();
    }
  })();
</script>
```

Replace the comment before saving. Do not put another pair of script tags inside this wrapper. It delays the complete generated loader until the body exists and prevents repeated initialization in the same document.

### 3. Save and update the site

In the builder, open **More (⋯) → Integrations**. Paste the completed wrapper into **Custom code**, preserving unrelated snippets. Save, then choose **Update website**.

Open the published URL. One launcher should appear and open. Continue with the [visitor test](#test-conversation).

Use one installation. A second copy in an Embed code element or tag manager can bypass this wrapper’s guard. The global integration supplies floating chat; this recipe does not place it inside a page element.

<a id="configure-widget"></a>

## Configure appearance and sessions

Keep widget settings in Voiceflow and installation in Hostinger.

Choose the launcher, colors and icon in Voiceflow’s **Widget** panel, then [publish the changes](/docs/documentation/deploy/environments/publishing). Replace the JavaScript inside the wrapper if the generated installation details change, then update the Hostinger site.

| Visitor action | What to check |
| --- | --- |
| Opens a public page | One launcher appears and opens. |
| Navigates or reloads | Chat stays usable without duplicate initialization. Retention follows the [widget persistence settings](/docs/documentation/deploy/widget/web-chat-api#configuring-chat-persistence). |
| Signs into an account | Public widget chat does not automatically gain customer-account permissions. |

This global installation covers the website. For selected-page visibility, have the site developer implement the intended behavior and test navigation in both directions. Protected account actions need backend authorization; a browser-supplied user ID is not proof of identity.

<a id="test-conversation"></a>

## Test a visitor conversation

Verify a useful reply through the widget on the updated website.

### 1. Open the published URL

Use a private browser window. Confirm that one launcher appears and opens. Test the updated website rather than relying on an integration field being saved or the editor canvas displaying the widget.

### 2. Ask a question and follow-up

Ask a prepared question, such as “What is your returns policy?” Then ask “How do I start a return?” Both answers should match the content in your agent’s Knowledge.

### 3. Check the project and navigation

Find the exchange in [Transcripts](/docs/documentation/measure/transcripts) to confirm the intended project. Visit another page, send a message and reload. Check retention, duplicate launchers and any visibility rules. Repeat with relevant consent choices if the site uses consent controls.

<a id="troubleshooting" />

### The widget does not appear

Check publication, the completed wrapper and browser requests.

Confirm you saved Custom code and updated the website. Make sure the wrapper’s comment was replaced with the generated JavaScript body, without nested script tags. On the published page, inspect Console and Network for a syntax error, a blocked `cdn.voiceflow.com` request or rejected setup. Review domain and consent restrictions with the project owner.

### The widget appears twice

Check other integrations and page elements.

Keep only the global wrapped installation. Remove older Voiceflow copies from other snippets, Embed code elements or tag managers, update the site and reload.

### An older installation still loads

Check the saved snippet and published site version.

Open the live page in a fresh window and inspect the installed code. Confirm the update reached the correct site and domain. Replace only the widget’s generated body if it still points to the previous project, then update again.

### The answer is wrong or missing

Verify the project and published agent.

Compare the installed generated options with the project’s current snippet. Check the intended release is published and retry with a fresh conversation. Correct missing policy information in Knowledge or instructions.

<a id="go-live"></a>

## Update the production site

Publish website code separately from the Voiceflow agent.

1. Have the Voiceflow owner publish the reviewed agent and widget settings.
2. Save the completed wrapper in the production builder’s **Custom code** field, then update the website.
3. Repeat the [visitor test](#test-conversation) on the production URL.

### Update or remove the widget

Maintain the global integration after release.

Publish later agent and appearance changes in Voiceflow. If installation details change, replace the generated JavaScript body inside the wrapper and update the Hostinger site.

To remove chat, delete only the widget’s wrapper, save and update the website. Open a fresh visitor window and confirm that the launcher is gone. Keep unrelated integrations intact.

<a id="custom-interface"></a>

## Custom interface guides

Planned Hostinger walkthroughs for your own conversation UI.

Custom chat and voice walkthroughs are **coming soon**, separately from this widget guide.

| Planned guide | API reference |
| --- | --- |
| Add custom chat | [Chat agents](/docs/api-reference/agent-runtime/chat) |
| Add custom voice | [Voice agents](/docs/api-reference/agent-runtime/voice) |
