How to Add Asyntai AI Chatbot to Adobe Experience Manager
Step-by-step guide for AEM 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 Page Component (Recommended)
The recommended method is to add the chatbot code to your AEM page component's head section for site-wide installation:
- Log in to your AEM Author instance
- Navigate to CRXDE Lite (typically at http://your-aem-instance:4502/crx/de)
- Locate your page component template (usually under
/apps/your-project/components/page) - Find or create the head.html or headerlibs.html file
- Add your Asyntai embed code to this file
- Click "Save All" in the top menu
- Replicate the changes to your publish instance
Tip: Placing the code in the head.html file ensures the chatbot appears on all pages using that template. This is the cleanest approach for site-wide installation.
Alternative Method 1: Client Libraries (ClientLibs)
For a more structured approach, you can use AEM's Client Library system:
- Create a new client library folder under
/apps/your-project/clientlibs - Set the cq:clientLibraryFolder node type
- Create a js.txt file listing your JavaScript files
- Add your Asyntai embed code to a JavaScript file in this folder
- Include the client library in your page component using:
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
data-sly-call="${clientlib.js @ categories='your-category-name'}" />
Note: This method is recommended for projects with existing ClientLib structure and provides better organization for larger implementations.
Alternative Method 2: Tag Management (Adobe Launch)
If you're using Adobe Launch (formerly DTM) or another tag manager:
- Log in to Adobe Experience Platform Launch
- Navigate to your property
- Go to Rules and create a new rule
- Set the event to "Page Bottom" or "DOM Ready"
- Add an action: Custom Code
- Paste your Asyntai embed code
- Save and publish the library
Tip: Using Adobe Launch is the Adobe-recommended approach for adding third-party scripts. It provides better control, testing capabilities, and doesn't require code deployments.
Alternative Method 3: Experience Fragment
For flexible, author-friendly implementation:
- Navigate to Experience Fragments in AEM
- Create a new Experience Fragment
- Add a Text component or HTML component
- Switch to HTML source mode
- Paste your Asyntai embed code
- Include this Experience Fragment in your page template footer
Important: Ensure you have proper AEM permissions to modify templates and components. For AEM as a Cloud Service, changes may need to go through your CI/CD pipeline.
Step 3: Verify Installation
After deploying your changes, clear your browser cache and visit your website. You should see the chat widget button in the bottom right corner. Click it to ensure it opens and functions correctly.
Not seeing the widget? Check your browser console (F12) for JavaScript errors. Verify the code was properly deployed to your publish instance. For AEM as a Cloud Service, ensure your changes went through the deployment pipeline successfully.
Weebly