Skip to content

Drupal integration

Add an AI chatbot to your Drupal website

Train an agent on your Drupal content and documents, then load it on every page through a library in your theme. No module to install, and you can test the agent before it goes live.

Create your agent free

Last updated:

How intoCHAT works on Drupal

Drupal loads JavaScript through asset libraries declared by your theme. intoCHAT fits that model: a library pointing at one external script adds a chat bubble to the corner of every page the theme renders. The agent answers from what you give it, such as your published pages, PDFs and Q&A pairs, and says so when it doesn't know. Colors, position and the welcome message are managed in intoCHAT, so the theme change is a one-time job.

Install intoCHAT on Drupal

  1. Create and train your agent

    Sign up for intoCHAT, create an agent and add your Drupal site's address on the Knowledge tab. intoCHAT finds your pages through your sitemap and links, and you can exclude paths such as /user with patterns.

  2. Copy your agent ID

    Open the Share tab and copy the agent ID from the code under Bubble Chat. The library definition only needs the ID.

  3. Declare the library

    In your own theme or sub-theme, add a chat_widget entry to THEME.libraries.yml that loads the script as an external file with the data-chatbot-id attribute, as shown below.

  4. Attach it to every page

    Add THEME/chat_widget to the libraries list in THEME.info.yml. Drupal loads library JavaScript in the footer by default, which is where the script needs to run.

  5. Clear caches and check

    Clear all caches under Configuration > Development > Performance, or run drush cr. Reload your site: the chat bubble appears in the bottom corner, with the colors and position from the Appearance tab.

The library definition

# THEME.libraries.yml
chat_widget:
  js:
    https://www.intochat.ai/api/embed.js:
      type: external
      attributes:
        data-chatbot-id: 'YOUR_AGENT_ID'

# THEME.info.yml: add to the existing libraries list
libraries:
  - THEME/chat_widget

Replace THEME with your theme's machine name. Don't add header: true: the script adds the chat bubble to the page body as soon as it runs, so it has to load in the footer. Drupal writes data-chatbot-id onto the script tag, which is where the script reads your agent ID.

What the agent does on your Drupal site

  • Learns from your Drupal pages

    Paste your site address and intoCHAT finds up to 500 pages through your sitemap and links. Exclude paths with patterns, so admin, login or search pages stay out.

  • Reads the files you publish

    Upload the PDFs, Word files and spreadsheets your site links to, or add text snippets and Q&A pairs. Q&A answers take priority over other sources.

  • Puts key sources first

    Star a source, such as your FAQ or pricing page, so it ranks higher in answers. No retraining needed.

  • Calls your endpoints

    Custom API actions let the agent call an HTTP endpoint during a chat, such as a REST or JSON:API route you expose. You choose the auth method and which response fields the model sees.

  • Collects leads in the chat

    A short form inside the conversation asks for an email address or phone number, on rules you set. Every new lead is emailed to you and up to five colleagues.

  • Replies in the visitor's language

    The agent answers in the language the visitor writes in, which suits multilingual Drupal sites.

Frequently asked questions

Is there an intoCHAT module for Drupal?

No. intoCHAT loads through a library in your theme, which takes a few lines of YAML and no contributed module. Use your own theme or a sub-theme, so updates to a contributed theme don't overwrite the change.

Why does the library have to load in the footer?

The script adds the chat bubble to the page body as soon as it runs, so the body has to exist by then. Drupal loads library JavaScript in the footer by default, and only header: true would move it into the head, so leave that setting out.

Does intoCHAT slow down my Drupal site?

The script is a single external file that Drupal outputs at the end of the page, after your content. The chat window runs in its own iframe served by intoCHAT, so its code stays separate from Drupal's JavaScript.

My site sends a Content Security Policy. What do I need to allow?

Allow www.intochat.ai for script-src, connect-src and frame-src. The script loads from that host, fetches your agent's settings from it and opens the chat in an iframe served from it.

Why doesn't the chat bubble appear after I add the library?

Clear all caches first, because Drupal caches library definitions and theme info. Then check that the library is listed in the info file of the active front-end theme, and that the agent ID matches the one on the Share tab.

Do I need to change the theme when I change the agent?

No. The library only carries your agent ID. Colors, position, welcome message, suggested questions and knowledge load from intoCHAT each time a page opens, so your changes appear without a deployment.

See it answer from your own website

Paste your website address and chat with an agent built from your pages. It takes about a minute.

Create your agent free

Free plan, no credit card needed.