How do I publish an assistant into Shopify?
A guide to embedding a LearnWise assistant into your Shopify storefront by adding a custom JavaScript file and theme reference so customers get AI support directly on your site.
2 min readUpdated
On this page
Integrating a LearnWise assistant into your Shopify store provides customers with instant 24/7 support and product guidance. This integration allows you to deliver AI-powered assistance directly within your Shopify storefront, improving customer experience and reducing support workload.
All of the instructions outlined below can also be found by navigating to the Publish tab inside your LearnWise admin dashboard and clicking on Shopify.
1. Access your Shopify admin #
- Log in to your Shopify admin dashboard at
https://yourstore.myshopify.com/admin. - From the left sidebar, navigate to Online Store.
- Click on Themes.
2. Open the code editor #
- Find your current active theme (it will have a Current theme badge).
- Click the Actions dropdown button next to your theme.
- Select Edit code from the dropdown menu.
3. Create a custom JavaScript file #
- In the code editor, locate the Assets folder in the left sidebar.
- Click Add a new asset.
- Select the option to create a new JavaScript file.
- Name the file
learnwise-assistant.js. - Click Create asset.
4. Add the LearnWise integration code #
- In the newly created
learnwise-assistant.jsfile, paste the following code:
window.learnWiseSetup = {
host: '<https://app.learnwise.ai>',
assistantId: 'assistantIdHere', // Replace this with your assistant ID
};
(function () {
var script = document.createElement('script');
script.src = '<https://cdn.learnwise.ai/assistant.js>';
script.async = true;
document.head.appendChild(script);
})();
- Replace
assistantIdHerewith your unique assistant ID from the LearnWise admin portal. - Click Save to save the file.
5. Link the script in your theme #
- In the Layout folder, click on
theme.liquid. - Scroll to find the closing
</head>tag. - Just before the closing
</head>tag, add the following line:
'learnwise-assistant.js' | asset_url | script_tag
- Click Save to apply the changes.
6. Confirm the assistant is live #
- Open your Shopify storefront in a new tab.
- The LearnWise assistant should appear on your site (usually in the bottom corner of the page).
- Interact with it to confirm it loads and responds correctly.
Troubleshooting #
- Assistant not showing up
- Double-check that
assistantIdinlearnwise-assistant.jsmatches the value in your LearnWise admin portal. - Confirm that you saved both
learnwise-assistant.jsandtheme.liquid.
- Double-check that
- Cached theme
- Clear your browser cache and refresh the storefront.
- If you use a CDN or performance app, make sure changes are published.
- JavaScript errors
- Open your browser dev tools (Right-click → Inspect → Console).
- Check for any JavaScript errors related to the LearnWise script and fix typos if needed.
- Custom / heavily modified themes
- Ensure there is a standard
</head>tag and that your script include is placed before it. - If your theme defers scripts in a special way, follow the theme’s recommended pattern and include the
learnwise-assistant.jsreference alongside other global scripts.
- Ensure there is a standard
Was this page helpful?
Still stuck?
Ask the LearnWise assistant. It answers from these guides.
Related guides
- How can I add AI Student Tutor within Blackboard?Build your assistant
- How do I install AI Campus Support on the Brightspace Login Page?Build your assistant
- How do I publish an assistant in Blackboard via the Ultra Extension Framework (UEF)?Build your assistant
- How do I publish an assistant into Microsoft Sharepoint?Build your assistant
- How do I publish an assistant into Microsoft Teams?Build your assistant