All guides

How to add the AISkillHub chat to Drupal

3 min read

Add Live chat or Global Room to a Drupal 10 or 11 site through your theme's html template, or with the Asset Injector module.

Before you start, create your widget and verify your domain. The overview guide explains both. Then copy your snippet from the widget's Install tab.

Drupal's text editor removes script tags from content, so do not paste the snippet into a block body. Use one of these instead.

Option 1: your theme's html template (recommended)

Use a sub-theme you control, so updates to a contributed theme do not remove it.

  1. Copy html.html.twig into your sub-theme's templates folder if it is not there yet. Core's version is in core/modules/system/templates/, or in your base theme.
  2. Paste your snippet just above {{ page_bottom }}, near the end of the body.
  3. Clear the cache: Configuration → Development → Performance → Clear all caches, or run drush cr.

Verifying with the meta tag? In the same template, paste the aiskillhub-verification meta tag inside the <head> section, clear the cache, then choose Verify in AISkillHub. DNS verification avoids template changes entirely.

Option 2: the Asset Injector module (no template edits)

  1. Install and enable the contributed Asset Injector module.
  2. Go to Configuration → Development → Asset Injector → JS Injector and add a new injector.
  3. Paste this code, with your own key, and save:
var s = document.createElement('script');
s.src = 'https://app.aiskillhub.dev/widget.js';
s.async = true;
s.setAttribute('data-widget', 'wgt_your_widget_key');
document.body.appendChild(s);

Leave the page conditions empty to load the chat on every page, or limit it to the pages you choose.

After you add it

If you use a reverse proxy cache such as Varnish or a CDN, purge it. Then open your site in a private window. Still stuck? See if the chat does not show up.

Get AISkillHub updates in your inbox.

New features as they ship, AI live chat improvements, and the best new listings in the catalog.

Product updates, new features, and guides. Unsubscribe any time.