← Setup guides

How to add a chatbot to your Drupal site

A Drupal chatbot needs one line of code. Drupal itself has no box for site-wide scripts, so this guide uses Header and Footer Scripts, a free contributed module that adds code just before </body> on every page. Developers can put the same line in the theme instead.

Before you start

Steps to add your Drupal chatbot

  1. Sign in, open your assistant's Widget page and copy the one line of code shown there. It starts with <script and ends with </script>.
  2. Install the Header and Footer Scripts module (drupal/header_and_footer_scripts with Composer), then enable it on the Extend page.
  3. Go to Configuration, then Development, then Header Footer Scripts, and open the Footer Scripts tab.
  4. Paste your code into the Footer Scripts box. The module adds it just before the closing </body> tag.
  5. Click Save configuration.
  6. Go to Configuration, then Development, then Performance, and click Clear all caches, so pages Drupal has already cached pick up the change.
  7. Open your website in a new tab and look for the chat bubble in the bottom-right corner, or bottom-left if you've moved it in Settings. Your Widget page shows "Live on your site" once it has been seen there.

Platform steps checked on November 13, 2026 against Drupal.org: Header and Footer Scripts

Good to know

Can't edit your website?

Every assistant has its own chat page. Link to it from your website's menu, your Google Business Profile, social media or email signature. Or use "Email this to my web person" on your Widget page to send the code to whoever runs your site.

Questions

Is there a Drupal chatbot module?

Drupal's AI modules can build a chatbot inside your site, connected to an AI provider you set up yourself. Ours runs on our side, answers from your website and your corrections, and only needs its one line added to your pages, which is what the module above does.

Does it work on Drupal 10 and 11?

Yes. The Header and Footer Scripts module's current release lists Drupal 8, 9, 10 and 11, and the chat itself works on any page that loads the line.

Can I add the chatbot to Drupal without a module?

Yes, if you or your developer edit your theme. Add the line just before </body> in your own theme or a sub-theme, never in a contributed theme an update will replace.

Try it on your own website

Your customers are asking right now

Paste your website and see your assistant answer as your business. It takes about a minute.

  • No account needed
  • No card
  • Free plan forever

Want the details first? See pricing