Skill - Shopify
Skill Type
Base Conversation
Overview
With the Shopify Skill, you can interact with a digital person while browsing a Shopify website. This skill is intended to be used with the digital person embedded into the website as a web widget. With this skill, users can search for products and then navigate to the page of the item. The user can ask questions about a product, such as: “What sizes does this come in?”, “Is black available?”. The user can ask to see their cart, and the skill will navigate to the user’s cart. If the user is on a product page, they can request it to be added to their cart.
Limitations
Searching for products is relatively limited due to constraints from the Shopify API Predictive Search endpoint. If a query does not yield any results, try rewording your request.
Product related questions are currently limited to just size and color.
When adding a product to cart, the skill will only add the item with the currently selected size, color, and quantity that is visible on the web page. It can only add a product if the user is currently on the product’s web page.
This skill functions as a BASE_CORPUS and is not compatible with other skills.
Skill Demo
Configurations
Provide the following information in the Shopify Skill configuration screen in Digital DNA Studio. See Adding Skills to your Digital Person for detailed instructions:
Field | Type | Description |
---|---|---|
ACCESS TOKEN TO USE THE SHOPIFY API REQUIRED |
| Enter your Shopify API key. |
WEB ADDRESS TO THE STORE REQUIRED |
| Example: ‘example.myshopify.com’ |
TEXT TO READ TO THE USER WHEN THE USER WANTS TO SEARCH FOR A PRODUCT |
| Hi, what are you looking for? |
TEXT TO READ TO THE USER WHEN THE PRODUCT IS FOUND |
| Here's what I found. |
TEXT TO READ TO THE USER WHEN THE PRODUCT IS NOT FOUND |
| Sorry, I was not able to find that product. |
TEXT TO READ TO THE USER WHEN AN ITEM IS ADDED TO THE CART |
| The item has been added to your cart. Can I help you find anything else? |
TEXT TO READ TO THE USER WHEN THEY WANT TO VIEW THEIR CART | TEXT | This is what's currently in your cart. |
TEXT TO READ TO THE USER WHEN THE DP DOESN’T UNDERSTAND THEM | TEXT | Sorry, I did not understand that. |
Obtaining Access Token for Shopify API
Obtain Admin access for the Shopify store you wish to create an access token for. Then navigate to https://<your_store>.myshopify.com/admin. Navigate to the Apps and sales channels. Then click on ‘Develop Apps’.
Click ‘Create an app’. Give it a name, choose yourself as the developer and then click ‘Create app’. You will be taken to a page for the app you just created.
Click ‘Configure Admin API scopes’. You will be able to check boxes for the scopes you want the access token to be able to access. The ones needed for this skill are ‘read_products’, ‘read_product_listings’. Then click ‘Save’.
Navigate to ‘API credentials’ and you should see a section titled ‘Access Tokens’ and a button right under it that says ‘Install App’. Click that button and then ‘Install’ in the next popup. Now in the same section, your API access token is revealed. Make sure you save it somewhere, as you will not see it again and will need to repeat this entire process if you lose the token.
Setting up Shopify Template
From your Shopify admin, go to Online Store > Themes.
Choose the theme you would like to use and click on the corresponding icon with the 3 dots. Click on Edit code and open up the
header.liquid
file.In this file, you will need to add two lines (“Project API Key” can be obtained in step 4):
<script src="https://static.soulmachines.com/dev/widget-snippet.min.js" data-sm-api-key="<Project API key>”></script>
<script src="https://raw.githubusercontent.com/soulmachines/skill-shopify-web-component/main/src/index.js"/>
In DDNA studio, Once you have created your Digital Person and configured it with the Shopify Skill, you should see a section Embed Code. Open up this section and you should see
data-sm-api-key
. This is what goes into theheader.liquid
script from the previous step.Once your theme code is saved and applied, and your Digital Person is deployed it should now appear in a widget in your Shopify site.