Add 'Ask a question' buttons to your help pages
The widget has a small JavaScript API. Use it to put suggested questions on your help and pricing pages, so visitors get an answer in one click.

Most visitors never open a chat bubble in the corner. They scroll, they skim, they leave. A button that says "Which plan do I need?" right next to your plans gets clicked, because it's the question they already had.
The TalkToMySites widget lets you build those buttons yourself. You don't need anything beyond the script tag you already installed.
The three functions
Once the widget loads, it adds window.TalkToMySites with three functions:
TalkToMySites.open() // open the chat panel
TalkToMySites.close() // close it
TalkToMySites.ask("Do you ship to Canada?") // open the panel and askask does exactly what a visitor would do: it opens the panel, sends the question and streams the answer with its Sources underneath. The full reference is in Customize the widget.
The catch: the widget may not be there yet
The install snippet uses defer, so the widget runs after your page's HTML has been parsed. The TalkToMySites global is set when the script runs, not before. If a button calls TalkToMySites.ask() before then, or if the script was blocked, the visitor gets a JavaScript error and nothing happens.
The fix is to check for the global at click time. One listener on the page handles every button:
<script>
document.addEventListener("click", function (event) {
var el = event.target.closest("[data-ask]");
if (!el || !window.TalkToMySites) return;
event.preventDefault();
var question = el.getAttribute("data-ask");
if (question) window.TalkToMySites.ask(question);
else window.TalkToMySites.open();
});
</script>Put it anywhere on the page. It reads window.TalkToMySites when someone clicks, so it doesn't matter whether the widget loaded first. If the widget isn't there, the listener steps aside and the element does whatever it normally does. That's why links make a good base: give them a real href and they still work without the widget.
An empty data-ask opens the panel without asking anything.
Pattern 1: suggested questions on a help or pricing page
Pick the three or four questions people actually ask. Your Top questions card on Analytics is the best source for these.
<p>Common questions</p>
<a href="/help/plans" data-ask="Which plan do I need?">Which plan do I need?</a>
<a href="/help/billing" data-ask="Can I change plans later?">Can I change plans later?</a>
<a href="/help/cancel" data-ask="How do I cancel?">How do I cancel?</a>Each link goes to the help page if the widget isn't loaded, and asks the assistant if it is.
Before you publish a suggested question, ask it yourself in the preview on your site page and check the answer. A button that leads to "I couldn't find that" is worse than no button. Test your assistant with ten questions has a quick way to do this.
If you only want a few starter questions inside the chat, add up to 4 under Suggested questions in Edit site instead. They show as buttons under the welcome message. Links like these are for putting the question on the page itself.
Pattern 2: "Ask about this" next to a confusing section
Some sections always cause questions: a refund policy with conditions, a usage limit, a feature that only works on some plans. Put a small link right next to it:
<h2 id="refunds">Refunds</h2>
<p>Your refund conditions...</p>
<a href="#refunds" data-ask="How do refunds work for annual plans?">Ask about this</a>Write the question the way a visitor would, specific to that section. "How do refunds work for annual plans?" gets a better answer than "Tell me more".
Pattern 3: your own nav button
If the floating bubble doesn't suit your design, or you want a second way in, add a button to your header:
<a href="/contact" data-ask>Ask us</a>With no question, the listener calls open(). Without the widget, the link goes to your contact page.
If you only want the bubble to look different, set a Launcher icon and Launcher label in Edit site, or use data-mode="search" to put an Ask AI box in your page. See Customize the widget.
We use this on talktomysites.com
Our own site works this way. On the homepage, the hero button Ask this site a question asks "How does it work on my site?". On the pricing page, Ask which plan fits asks "Which plan do I need?". Both are plain links, and a click listener hands them to TalkToMySites.ask() once the widget has loaded. Until then, the link just changes the page's hash. Try them to see what a visitor sees.
Things to know
- Each click is a real question. It counts toward your monthly questions, the same as a typed one. See Plans and limits.
- It shows up in Analytics like any other question. The widget records the page it was asked on, so Where visitors ask shows which pages your buttons are on. Top questions groups questions by wording, so clicks on one button count together (along with visitors who typed the same words).
- Keep questions short and answerable. If the assistant can't answer a button's question, fix the page first. Why the assistant says "I don't know" covers how.
If you haven't installed the widget yet, start with Install the widget with one script tag.


