Skip to content

Troubleshooting

View as Markdown

Find your symptom below. For a missing widget, work through the checks in order; the first one that fails is almost always the cause.

SymptomMost likely cause
No chat button, and POST /widget/session returns 401The page’s hostname isn’t in your allowed domains, or the site key is wrong
widget.js returns 404The script src doesn’t point at https://widget.agentmysite.com/loader/widget.js
Session returns 200, but the chat window is blank or missingdata-iframe-origin is missing or wrong, or a Content Security Policy blocks the frame
Works on one domain but not anotherThe other hostname isn’t in your allowed domains (www and the bare domain are different)
The chat button appears, then nothing happensMixed content, or a Content Security Policy blocks the API or the frame
Message box disabled, “Assistant unavailable”Your credits for the period are used up
“I can’t help with that” style answersThe content that answers the question is missing or not Ready

Open your page, then open your browser’s developer tools and select the Network and Console tabs. Reload the page.

Filter Network for widget.js.

  • 200: the loader is fine. Go to the next check.
  • 404 or no request: check that the snippet’s src is exactly https://widget.agentmysite.com/loader/widget.js, and that the snippet is on this page. Copy it again from Site Settings > Site key & embed snippet.

Filter Network for session. The widget calls POST https://api.agentmysite.com/widget/session when it starts.

StatusMeaningFix
401The page’s hostname isn’t in your allowed domains, or the site key doesn’t exist. The widget shows nothing.Find the Origin request header, for example https://shop.acme.com. Add its hostname, shop.acme.com, in Site Settings > Allowed domains. Check that data-site-key matches the key in Site Settings exactly.
429Too many sessions were started in a short time.Wait a minute and reload.
Failed, CORS or blockeddata-api-base is wrong, or the page is https and the API address is http.Use data-api-base="https://api.agentmysite.com", as in your snippet.
200The session is fine.Go to the next check.

Look in Network for a request to https://widget.agentmysite.com/iframe/.

  • Missing, or sent to api.agentmysite.com: data-iframe-origin is missing or wrong. When it’s missing, the widget tries to load the chat window from the API host, which fails silently. Set data-iframe-origin="https://widget.agentmysite.com", or copy the full snippet again.
  • 200, but blank: check the Console for Content Security Policy errors (next check).

If your site sends a Content-Security-Policy header, the Console shows lines starting with Refused to load, Refused to connect or Refused to frame. Allow these sources:

Content-Security-Policy
script-src 'self' https://widget.agentmysite.com;
connect-src 'self' https://api.agentmysite.com;
frame-src https://widget.agentmysite.com;

A missing connect-src is the most common cause of a widget that fails silently.

In the Elements tab, search for agentmysite-widget-iframe.

  • Not found: the widget stopped at an earlier check. Go back to checks 1 to 4.
  • Found, but you can’t see it: your page’s CSS is covering it. The widget is fixed to the bottom-right corner. Look for an element with a higher z-index in that corner, or a parent with overflow: hidden or a transform.

Paste this into the browser console on your page, with your site key, to test the session directly:

fetch("https://api.agentmysite.com/widget/session", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ siteKey: "YOUR_SITE_KEY" }),
}).then((r) => r.json().then((j) => console.log(r.status, j)));
// 200 and a token: the session works; check the chat window and CSP
// 401: add this page's hostname to Allowed domains, or check the site key

Inside some embedded frames and in private browsing, the browser blocks storage. The widget still works, but it can’t remember the visitor between page loads, so history starts fresh after a reload.

If the message box is disabled with the placeholder Assistant unavailable, your account has used all its credits for the period. Check Dashboard > Plan & usage. See Credits and billing.

  • The assistant says it can’t help. It only answers from your content. Check that a page or document covers the question and that its status is Ready on the Documents page. The question also appears on the Unanswered page.
  • Answers are out of date. Re-sync changed web pages, and replace changed documents. See Keep content fresh.
  • A document failed. Read the reason under its name on the Documents page. See Fix a failed document.
  • A web page has little useful text. Pages that need a login or build their text with JavaScript may not have readable text. Upload the content as a document instead.

To see which sources an answer used, open the conversation in Conversations and select Show N sources under the reply.

To protect your credits from abuse, each visitor can send up to 20 messages in 10 minutes, and each site up to 200 messages in 10 minutes. A message can be up to 2,000 characters.

Email support@agentmysite.com with your site name, the page address, and a screenshot of the Network tab.