How to Add Asyntai AI Chatbot to Kentico

Step-by-step guide for Kentico CMS websites

Get Embed Code

Step 1: Get Your Embed Code

First, go to your Asyntai Dashboard and scroll down to the "Embed Code" section. Copy your unique embed code which will look like this:

<script async src="https://asyntai.com/static/js/chat-widget.js" data-asyntai-id="YOUR_WIDGET_ID"></script>

Note: The code above is just an example. You must copy your own unique embed code from your Dashboard as it contains your personal widget ID.

Step 2: Add Code to Master Page Template (Recommended)

To add the chatbot to all pages of your Kentico website at once, use the Master Page Template method:

  1. Log in to your Kentico Admin and navigate to Page templates application
  2. Locate and open your Master page template (the template used across all pages)
  3. Click on the Header tab in the template editor
  4. In the header section, paste your Asyntai embed code
  5. Alternatively, add the code to the template's layout before the closing </head> tag
  6. Click Save to apply the changes
  7. Clear your site's cache and verify the changes on the live site

Tip: Using the Master Page Template ensures the chatbot appears on every page that inherits from this template. This is the most efficient method for site-wide deployment in Kentico.

Alternative Method 1: Page Template Header

If you want to add the chatbot to specific page templates only:

  1. Go to Page templates application in Kentico Admin
  2. Select the specific page template you want to edit
  3. Click on the Header tab
  4. Add your Asyntai embed code using a script tag:
<script async src="https://asyntai.com/static/js/chat-widget.js" data-asyntai-id="YOUR_WIDGET_ID"></script>
  1. Click Save
  2. All pages using this template will now include the chatbot

Note: This method is useful when you want to add the chatbot to specific sections of your site that share the same page template, rather than the entire site.

Alternative Method 2: HEAD HTML Web Part

For more granular control on specific pages or for inheritable JavaScript across subpages:

  1. Open the page you want to edit in the Kentico Page editor
  2. Add a new web part to the page (preferably in a parent page for inheritance)
  3. Search for and select HEAD HTML web part
  4. In the web part configuration, paste your Asyntai embed code
  5. Configure the web part to be inheritable if you want child pages to have the chatbot
  6. Click OK to save the web part
  7. Save and publish the page

Tip: The HEAD HTML web part is perfect for adding code to a parent page that will automatically propagate to all child pages, creating a section-wide installation.

Alternative Method 3: Custom JavaScript Files (Advanced)

For developers who prefer managing scripts as files:

  1. In your Kentico project, navigate to ~/CMSScripts/Custom/ directory
  2. Create a new JavaScript file (e.g., asyntai-widget.js)
  3. Add code to dynamically load your Asyntai widget:
(function() { var script = document.createElement('script'); script.src = 'https://asyntai.com/static/js/chat-widget.js'; script.setAttribute('data-asyntai-id', 'YOUR_WIDGET_ID'); script.async = true; document.head.appendChild(script); })();
  1. Reference this file in your Master Page Template's header:
<script src="~/CMSScripts/Custom/asyntai-widget.js"></script>

Important: This advanced method requires file system access and knowledge of Kentico's directory structure. Make sure you have proper permissions and always test in a staging environment first.

Step 3: Verify Installation

After saving your changes and clearing the cache, open your website in a new browser tab or incognito window. You should see the chat widget button in the bottom right corner. Click it to make sure it opens and works correctly.

Not seeing the widget? Make sure you've saved all changes and cleared Kentico's cache (Settings > System > Clear cache). Try viewing your site in an incognito window. Check the browser console (F12) for any JavaScript errors that might prevent the widget from loading.