Skip to content
Plugins and integrations5 min read

Add the chat to a Wix site

Paste the snippet into Settings, Custom Code, set it to all pages and Head, and the chat bubble is live on your published Wix site.

Browse topics

What it is

Wix has a built-in place to paste third-party code called Custom Code. Agentency uses it: you copy one <script> tag from your dashboard, paste it into Wix once, and the chat bubble appears on every page of your site. There is nothing to install from the Wix App Market, and you never touch your template.

The tag carries two things that make it work — a widget token that says which chatbot to load, and the address of the Agentency API it should talk to. Both are already filled in for you when you copy the snippet, which is why you should copy rather than retype it.

When you would use it

Use this when your site is built in Wix (the Wix Editor, Wix Studio, or Editor X) and you want live chat on every page without hiring a developer. If you only need a link you can send to customers on WhatsApp or Instagram, the hosted chatbot link is simpler and works on the Free plan.

Where to find it

Open Dashboard → Chatbots → your chatbot → Integrations → Plugins → Wix.

Before you start

Wix has three requirements of its own, and missing any of them is the usual reason a snippet appears to do nothing:

  • Your site must be published. Custom Code never runs on an unpublished draft.
  • You need a connected domain, which in practice means a paid Wix plan. Custom Code does not run on a free wixsite.com preview address.
  • You need to be the site owner or have permission to edit site settings.

On the Agentency side, make sure the chatbot is Active on its Playground tab, and add your domain to the widget allowlist first — see Allow the widget on your domains. A chatbot with an empty allowlist refuses to load anywhere, so doing this before you paste saves you a confusing round trip.

Steps

  1. Open Dashboard → Chatbots → your chatbot → Integrations → Plugins and click the Wix card.
  2. Click Copy embed code. Keep it on your clipboard — do not edit it.
  3. In a second tab, open your Wix site dashboard → Settings, then click Custom Code (it sits in the Development & integrations group).
  4. Click + Add Custom Code at the top right.
  5. Paste the snippet into the code box.
  6. Give it a name you will recognise later, such as Agentency chat.
  7. Under Add Code to Pages, choose All pages, then choose Load code once so the widget is not re-initialised on every page view.
  8. Under Place Code in, choose Head.
  9. Click Apply.
  10. Publish your Wix site if it has unpublished changes, then open it in a normal browser tab and send a test message. It will show up under Conversations within a few seconds.

What the snippet looks like

This is the shape of the code Wix will receive. Yours has your own token and version in it — copy it from the Plugins drawer instead of typing this out:

<!-- Wix: Settings -> Custom Code -> Head, All pages, Load once -->
<script src="https://agentency.com/js/chatbot-widget.js" defer data-widget-token="wt_YOUR_WIDGET_TOKEN" data-api-base-url="https://api.agentency.com" referrerpolicy="strict-origin-when-cross-origin" crossorigin="anonymous"></script>

Two details matter. data-widget-token is what tells Agentency which chatbot to open — remove it and the widget refuses to start. defer is what stops the chat from slowing down your page: the browser finishes drawing your site first and loads the chat afterwards.

What you will see

In Wix, your entry appears in the Custom Code list with the name you gave it, marked as loading in the Head on all pages. You can switch it off there at any time without deleting it.

On your live site, a chat bubble appears in the corner within a second or two of the page settling. Its colour, position, and greeting all come from your chatbot's settings in Agentency, not from Wix — change them under Change the widget look and position and the live site picks the change up on the next reload.

Limits and plan notes

Embedding on your own site is a paid Agentency feature. On the Free plan the Plugins tab shows every platform card locked, and you share the hosted link instead. See Which plans include integrations and the pricing page for the current tiers.

Wix Custom Code has its own gate: a published site on a paid Wix plan with a connected domain. Wix also does not support technical issues in third-party code, so if the chat misbehaves, come to us rather than to Wix support.

The snippet does not read your Wix Stores products, bookings, or orders. It puts the chat on the page; teaching the chatbot about your catalogue is a separate job you do by adding knowledge, or by wiring up a Call action that queries your own system live.

Common problems

I applied the code and nothing happens on my site.

Nine times out of ten the site has not been republished since you added the code, or the address you are testing is the free wixsite.com one. Publish, then test on your real domain.

The bubble shows on my home page but not on new pages.

The code was added to specific pages rather than All pages. Edit the entry in Custom Code and change the page selection.

The chat opens but says it cannot connect.

Your domain is missing from the allowlist. Add both example.com and www.example.com if visitors can reach you either way — see The widget is blocked.

I pasted the code into a page element instead.

An HTML embed element draws a box inside your page layout. The chat widget needs to sit in the site's Head so it can float above every page. Remove the element and use Settings → Custom Code.

Common questions

Do I need a paid Wix plan?

Effectively yes. Wix only runs Custom Code on a published site with a connected domain, which a free wixsite.com address does not have.

Where exactly does the code go?

Site dashboard → Settings → Custom Code → Add Custom Code, with Add Code to Pages set to All pages and Place Code in set to Head.

Should I use an HTML embed element instead?

No. An embed element draws a fixed box inside your layout. The chat needs to sit in the site Head so it can float above every page.

Why does nothing happen after I click Apply?

The site has usually not been republished since the change, or you are testing the free wixsite.com preview address instead of your domain.

Was this article helpful?

Ready to try it on your own content?

Create a free workspace, add a document, and ask the questions your team is tired of answering.