Ghost is built for publishing, not for support, so reader questions about subscriptions, sponsorships or past articles usually land in your inbox. A chatbot can answer the repeat ones from your own posts and pages. Here’s how to add Feedbot (we make it) to Ghost.
What you need
- A Feedbot bot id from Dashboard → Bot → Install. The Free plan is enough to start.
- Owner or Administrator access to Ghost Admin.
- Any Ghost(Pro) plan or a self-hosted Ghost install. Code injection is available on both.
Add the chatbot to every page
-
Sign in to Ghost Admin (
yoursite.com/ghost). -
Click the Settings gear in the bottom-left corner.
-
In the Advanced section, find Code injection and click Open.
-
Paste this into Site footer:
<script src="https://w.feedbotai.com/v1/feedbot.js" data-bot-id="YOUR_BOT_ID" async></script> -
Click Save and open your site in a new tab. The chat button appears in the bottom-right corner.
Ghost places Site footer code just before the closing </body> tag on every page, which is where scripts belong. Ghost’s own guide to code injection covers the same screen.
If Portal’s Account or Subscribe button also sits in the bottom-right corner, move the chat to the left so they don’t overlap: add data-position="bottom-left" to the script tag, or change the position in the Feedbot dashboard.
Show it on some pages only
| Goal | How |
|---|---|
| One post or page only | Open the post in the editor, click the settings icon (top right), open Code injection and paste the script into Post footer. Leave Site footer empty. |
| Every page except some | Use the conditional snippet below in Site footer. |
<script> // Skip the chat on the homepage and on /tag/ archives. if (location.pathname !== "/" && !location.pathname.startsWith("/tag/")) { var s = document.createElement("script"); s.src = "https://w.feedbotai.com/v1/feedbot.js"; s.async = true; s.dataset.botId = "YOUR_BOT_ID"; document.body.appendChild(s); }</script>Pass member details (optional)
Code injection doesn’t process Handlebars, so it can’t read who is signed in. Your theme can. Ghost themes expose an @member object with email, name, uuid and paid. Add this to default.hbs, before {{ghost_foot}}:
{{#if @member}}<script> window.Feedbot = window.Feedbot || function () { (Feedbot.q = Feedbot.q || []).push(arguments) }; Feedbot("identify", { email: "{{@member.email}}", name: "{{@member.name}}", metadata: { paid: {{#if @member.paid}}true{{else}}false{{/if}} } });</script>{{/if}}Two caveats. First, editing default.hbs means uploading a custom or modified theme, which on Ghost(Pro) needs a plan that allows custom themes (pricing). Second, Ghost has no place to compute the server-side hash Feedbot uses for verification, so these members stay unverified: the bot sees their name, email and paid status, but they don’t get chat history across devices. That’s enough for “I’m a paid member and can’t log in” conversations. See Identify users.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| No chat button after saving | Browser or CDN cache | Hard-refresh, or open the site in a private window. |
| Button hidden behind the Portal button | Both in the bottom-right corner | Add data-position="bottom-left" to the script tag, or change the position in the Feedbot dashboard. |
| Script shows as text on the page | Pasted into a post body instead of Code injection | Remove it from the post and use Site footer or Post footer. |
| Requests rejected | Domain not in Allowed domains | Add your Ghost domain (and the ghost.io subdomain if you use it) in Bot → Install → Allowed domains. |
Member name shows ' |
Handlebars escapes quotes in names | Cosmetic. Use {{@member.firstname}} or leave the name out. |
Train it on your posts
From Starter, add your site in Bot → Knowledge as a website source, or use https://yoursite.com/sitemap.xml to import the pages Ghost lists there. Click Refresh website after you publish new posts; sites aren’t re-crawled automatically. Put membership prices and support contacts in the business profile so the bot always knows them. Details: knowledge base.
When a reader asks for a person, the bot hands the conversation to you in Telegram, Slack, Discord or email (handoff), and readers who leave an email show up as leads.
Next steps
- Install docs for color, language and inline mode.
- Prefer managing scripts in one place? Use Google Tag Manager.