How to integrate your chatbot with Shopify
Below is an instruction guide that describes the process of adding a chatbot to a Shopify store and integrating it with the API to enable integration.
- How to integrate your chatbot with Shopify
- 1. Install chatbot on Shopify store
- Obtain code snippet
- Install chatbot on shopify store
- 2. Integrate chatbot with Shopify API
- Prerequisites
- How it works
- Create integration in Shopify Store
- Generate API Key in Shopify Store
- Activate integration for your chatbot.
1. Install chatbot on Shopify store
Obtain code snippet
Log in to ChatLab, select the chatbot that you will embed and click on it
- Click on “Add to website”
- Choose between widget and iframe
- Click “Copy to clipboard”
Install chatbot on shopify store
Login to you administration panel and go to `Sales channels - Themes` under `Online Store` section
Click three little dots for more theme actions - and select `Edit code`
Find ‘theme.liquid’ section under layout, open it and paste the widget code obtained in first step within the <head> </head> section. Once done click the ‘Save” button.
2. Integrate chatbot with Shopify API
To connect your Shopify store with Chatlab, you'll need your store's URL and an API access token. This guide will show you how to generate and locate the API token in your Shopify store and how to connect your chabot with the API.
Prerequisites
Before you start - make sure you have ChatLab Standard or Premium subscription that allows for Shopify integration. Check the pricing page
How it works
Product Search
The chatbot's product search feature enables users to find products in your Shopify store effortlessly. Users can enter a phrase, and the chatbot will perform a case-insensitive search across multiple fields in the product database, ensuring a comprehensive and accurate matching process. This allows users to discover relevant products quickly and conveniently, enhancing their shopping experience.
Order Details
With the order details feature, users can inquire about the status of their orders by providing two key details: the order identifier and the email address associated with the order. Both parameters are validated against your Shopify store’s records, and order information is retrieved only if there is a match.
The chatbot returns the following details for the matched order:
- Total Price: The total value of the order.
- Ordered Items: A list of items in the order, including:
- Name: The name of the product.
- Quantity: The number of units ordered.
- Price: The unit price of the product.
- Shipping Address: The delivery address provided for the order.
This integration ensures a smooth and efficient way for users to check order information without navigating the Shopify store interface.
Create integration in Shopify Store
Go to Settings → Apps and sales channels
Choose 'Develop apps’.
On ‘App Development’ page click ‘Create an app’
Provide a custom name and click ‘Create app’
Once created - configure access for chatbot - Click ‘Configure Admin API scopes’
Under "Admin API access scopes" find the permissions read_orders
and read_products
and click to tick the box for each, then click the 'Save' button.
Generate API Key in Shopify Store
Navigage to the API credentials tab and click ‘Install app’
Confirm the installation by clicking on 'Install' in the window that appears.
When your Admin API Access Token has been generated click on 'Reveal token once' and copy your token.
The other thing which is requried to integrate with chatbot is the subdomain of your store. You can find it easily on the top of the administration menu. For example, the subdomain might be ‘19d511-4a’.
Activate integration for your chatbot.
Login to chatlab admin console , select the bot and go to Integrations tab.
Navigate to ‘Shopify’ section, enable integration with shopify by switching it on and provide token and subdomain you obtained in previous steps.
Afterward click ‘Update Chatbot’ button. It will save changes and test integration. You should receive a confirmation message indicating the integration works properly.