Install guide

Adding a chat assistant to a Squarespace site

Squarespace gives third-party scripts one purpose-built field, which makes the install a single paste. What is worth reading first is the short list of surfaces that field does not cover, because two of them are the ones a first-time visitor is most likely to land on.

The tag

<script src="https://cdn.askably.xyz/w.js" data-key="pk_live_YOUR_KEY" defer></script>

Your own key replaces the placeholder. You will find it on the install tab of the assistant.

The origin the page is served from has to be on the allowlist for that assistant, or nothing renders and the browser console says which origin was refused. An apex domain and its www are two different origins to a browser, so list both, along with any staging or preview host you want it to work on.

Where it goes on Squarespace

Settings, then Advanced, then Code Injection, then the Footer field.

Code Injection is available on a business plan and above. Personal plans do not have the field at all, and there is no route around it inside Squarespace worth recommending.

Step by step

  1. 1In the site dashboard open Settings, then Advanced, then Code Injection.
  2. 2Paste the tag into the Footer field rather than the Header field, so it lands at the end of the body.
  3. 3Save. Squarespace applies Code Injection to the live site without a separate publish step.
  4. 4Open the live address in a private window. Do not judge the result from the editor preview.
  5. 5If you want the assistant on a single page only, take it out of the site-wide Footer field and use the code injection field in that page's own settings instead.
  6. 6If the launcher does not appear, read the browser console on the live page before changing anything, because a refused origin and a missing tag look identical from the outside.

What goes wrong on Squarespace

Cover pages and the lock screen sit outside injection

A Squarespace cover page and the site-wide password lock screen are rendered from Squarespace's own templates rather than from your site layout, so site-wide Code Injection does not run on either of them.

The visible symptom is a visitor who lands on your cover page, sees nothing, clicks through to the real site, and then finds a launcher. If your cover page is the page people arrive on, the assistant is missing exactly where you wanted it.

The editor preview is not the published page

The Squarespace editor renders your pages inside its own shell, and injected code is not reliably executed there. People add the tag, look at the editor, conclude it failed, and start troubleshooting a working install.

Always check in a private window on the real address, which also rules out a cached page and a logged-in session at the same time.

The built-in address is a different origin

Every Squarespace site keeps a squarespace.com address alongside any domain you connected, and to a browser those are separate origins. If you test on the built-in address and only allowlisted the custom domain, nothing renders and the console names the address it refused.

Origins to allowlist

These are the origins a Squarespace site is typically served from. List every one you want the assistant to answer on, including the ones only you visit.

  • https://your-site.squarespace.com
  • https://yourdomain.com
  • https://www.yourdomain.com

How the tag behaves, wherever you put it

The rest of this is the same on every platform, so it is worth reading once rather than on each guide.

Loader behaviour
One tag, nothing elseThere is no second file, no stylesheet and no package to install. The tag is the whole install.
Where it goesImmediately before the closing body tag. It works in the head too, because it defers, but the body keeps it out of the way of anything that measures render order.
data-key is requiredWithout it the loader stops and writes a warning to the browser console rather than rendering anything.
It finds itselfThe loader reads the tag it was loaded from, and falls back to the first tag on the page carrying a data-key. Platforms that move or re-inject the tag do not break it.
It installs onceA second copy of the tag on the same page is ignored, so a template that renders twice does not produce two launchers.
Assets follow the tagEverything else it needs is fetched from the same origin the tag was served from, so a proxy or a private domain needs no extra configuration.
The panel loads lateOnly the small launcher is on the page at first. The conversation panel is fetched the first time a visitor opens it, in its own frame.
Styles cannot collideThe launcher renders inside a closed shadow root and the panel inside a frame, so nothing on the host page can restyle either, and neither can restyle the host page.

Set up on Squarespace for a particular trade

Taking it off again

Open Settings, then Advanced, then Code Injection, clear the tag from the Footer field, and save. If you also used a per page injection field, clear that one too.

Before you remove it

  • Removing the tag stops the widget on that site. It does not delete the assistant, its material, or the enquiries it has already collected.
  • If you are moving the widget to a different host rather than retiring it, add the new origin to the allowlist before you remove the old tag, or there is a window where neither works.

Questions

I am on a personal plan. Is there any way to do this?
Not honestly. Code Injection is the only supported place for a third-party tag on Squarespace, and it is gated by plan. The choices are to upgrade or to host the page somewhere that allows a script. Anything else you are offered is a workaround that breaks at the next platform update.
Does it appear on commerce pages as well?
Yes. Product and category pages are ordinary pages of your site, so the site-wide footer injection reaches them like any other. Checkout is a different matter and is handled by Squarespace rather than by your site layout.
Can I use per page injection to keep it off my blog?
No, and this trips people up. Per page injection adds code to one page. It cannot subtract the site-wide field from another. If you need the assistant on some pages only, remove it from the site-wide Footer and add it page by page instead.
What material is worth indexing for a Squarespace site?
The pages you already wrote to answer questions: services or pricing, the FAQ, the policies, and the about page that explains who you are and where you work. If those pages are public, a crawl of your own site reads them as a visitor would.

Keep reading

Try it on your own material

Upload a document or point it at your site, paste one line of HTML, then ask it something only your business could answer.