Add the button
1
Add the helper script once
Add this script to every page, for example in your theme’s The first part makes the button safe to click before the widget finishes loading. An early click is saved and runs once the widget is ready.
<head>. Add it once for the whole site.askAI() works before and after the widget loads.2
Add the button
To open the chat only:To open the chat and ask a question for the shopper:The question appears in the chat as the shopper’s message, and your Agent replies.
3
Style the button
It is a normal button, so style it with your own theme classes or CSS. The widget does not style it.
4
Test the button
- Load a page and click the button. The chat opens.
- Hard-refresh the page and click the button straight away. The chat opens once the widget is ready.
- If your button asks a question, let the page finish loading, then click it. The question appears as the shopper’s message, and your Agent replies.
Available functions
askAI() uses these functions. You can also call them from your own code.
Pages that already use
CrosswordAgent keep working. No change is needed.When the button does nothing
- The page is hidden by your page rules. If your page rules hide the widget on a page, the button does nothing there. The click is not saved for later.
- The chat is waiting for cookie consent. If you turned on Also block chat until consent is given, the button does nothing until the shopper accepts cookies. Clicks before that are not saved.
- A capture sheet is due. If a capture sheet opens on the shopper’s first message, the question waits. It is sent once the shopper finishes the sheet.
- Your page already uses the name
Crossword. The widget always takes the namewindow.Crossword. If your page has its ownCrossword, such as a script variable or an element whoseidornameisCrossword, early clicks are lost. Rename yours. - The shopper clicked before the chat was ready. The chat opens, but the question may not be sent. The shopper can type it, or click the button again.

