How to Add Asyntai AI Chatbot to Odoo
Step-by-step guide for Odoo websites
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 Using Code Injection (Odoo 16+)
If you're using Odoo version 16 or later, you can use the built-in Code Injection feature to add the chatbot to all pages:
- Log in to your Odoo backend and go to the Website app
- Click Edit to enter the website editor
- Click the Theme option in the editor toolbar
- Navigate to Website Settings
- Find and click on Code Injection
- Click the </body> option to add code before the closing body tag
- Paste your Asyntai embed code in the code editor
- Click Save to apply the changes
Tip: Adding the code to the </body> section places it just before the closing body tag, which is the recommended placement for chat widgets and won't slow down your page loading.
Alternative: Using HTML Editor (Odoo 14-15)
For Odoo versions 14 and 15, you can use the HTML Editor to add the code:
- Log in to your Odoo backend and go to the Website app
- Click Edit to enter the website editor
- Click the Customize dropdown menu
- Select HTML/CSS/JS Editor
- Choose Main Layout from the list of editable templates
- Scroll to the bottom of the template, just before the closing
</t>tag - Paste your Asyntai embed code
- Click Save and refresh the page
Important: When editing the HTML directly, make sure to use valid XHTML syntax. Your script tag should be self-closed if needed. The changes will apply to all pages on your website.
Alternative: Developer Method (Custom Module)
If you're a developer or have access to custom Odoo modules, you can create a template that inherits from the website layout:
<template id="asyntai_chatbot" inherit_id="website.layout">
<xpath expr="//div[@id='wrapwrap']" position="after">
<script async="async" src="https://asyntai.com/static/js/chat-widget.js" data-asyntai-id="YOUR_WIDGET_ID"/>
</xpath>
</template>
Note: This method requires creating a custom Odoo module and adding the above code to your module's XML views. After adding, update your module list and install the module.
Step 3: Verify Installation
After saving your changes, 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 your changes and cleared your browser cache. Try viewing your site in an incognito window. If you made changes via the HTML Editor, you may need to refresh the page or clear Odoo's assets cache.
Weebly