Setup WhatsApp Chatbot for Shopify
Once you have completed the integration, you will be able to control your chatbot content in the proxy trees. In this section, you will be able to learn how to customize your WhatsApp Chatbot conversations by editing the Config Map.
Sample Tree Structure
Part 1 - Proxy Tree
Finding the Proxy Tree
Procedure
Head to "Bot Builder".
Search for "[Shopify] WhatsApp - Proxy Tree".
- Select the tree.
Viewing the Config Map
Procedure
- Select Config Map to edit the variables. If you do not know how to use this config map, please proceed to next step.
Part 2 - Editing the Config Map
Full Config Map
Proxy Tree Structure
What is Your Result?
Procedure
- Open the config map for "[Shopify] WhatsApp - Proxy Tree". Below is a general structure of the config map.
{
"INTEGRATION_ID": "{{INTEGRATION_ID}}",
"MISCELLANEOUS": {...},
"FLOW_END": {...},
"PRODUCT_RECOMMENDATION": {...},
"COLLECTION": {...},
"PRODUCT_SEARCH": {...},
"COUPON": {...},
"RECENT_HAPPENINGS": {...},
"MEMBER_GET_MEMBER": {...},
"REFER_SUCCEED": {...},
"ORDER_CREATE": {...},
"ORDER_UPDATE": {...},
"PAYMENT_CONFIRMATION": {...}
}
- Follow the table below and find out the part you wish to edit in the config map. The corresponding config map settings will be provided for each part, so that you can copy and paste it over the
{...}
as shown in the above sample code.
Field | Content |
---|---|
INTEGRATION_ID | Generated by Stella |
MISCELLANEOUS | Chatbot Flow Openings & Miscellaneous chatbot contents. Object consists of different miscellaneous fields |
FLOW_END | Chatbot contents for the Ending of Conversation Flow. Object consists of different fields related to complete flow message |
PRODUCT_RECOMMENDATION | Product Recommendation chatbot contents. Object consists of different fields related to product recommendation flow |
COLLECTION | Chatbot contents for the Search by Collection flow. Object consists of different fields related to collection flow |
PRODUCT_SEARCH | Chatbot contents for the Search Product by Keyword flow. Object consists of different fields related to product search flow |
COUPON | Coupon Flow chatbot contents. Object consists of different fields related to coupon button in Shopify store |
RECENT_HAPPENINGS | Recent Happenings Flow chatbot contents. Object consists of different fields related to recent happenings flow |
MEMBER_GET_MEMBER | Chatbot contents for the Members-Get-Members Sharing Mechanism. Object consist different fields related to member get members flow |
REFER_SUCCEED | Chatbot contents for Successful Member Referral. Object consists of different fields related to member get members flow |
ORDER_CREATE | Order Creation flow chatbot contents. Object consists of different fields related to order creation one time notification |
ORDER_UPDATE | Order Update flow chatbot contents. Object consists of different fields related to order update (delivery) one time notification |
PAYMENT_CONFIRMATION | Chatbot contents for Payment Confirmation. Object consists of different fields related to payment confirmation notification |
Select "Done" and "Save" the tree.
Save and see if you can produce the expected result.
Chatbot Flow Openings & Miscellaneous (MISCELLANEOUS)
What is Your Result?
Procedure
Edit MISCELLANEOUS part of config map
After editing the name of a field in "Flow Openings", please remember to edit the name in the "Flow Endings" accordingly. For example, if you have edited the "COLLECTION_NAME" at row 39, you will nedd to "COLLECTION" at row 135 as well.
Click to view code
{
"API_VERSION": "2020-10",
"DEFAULT_LANGUAGE": "en",
"MAIN_MENU_KEYWORD": "0",
"AVAILABLE_LANGUAGES": [
"en",
"zh_tw"
],
"LANGUAGES_MAPPING": {
"(zh_)+": "zh_tw"
},
"GREETING_MENU_MESSAGE": {
"en": "Hi there 😊, I am a robotic assistant 🤖 to {{shopName}}! \n\nWould you like to check out\n{{greetingList}}\n\nShould you wish to contact us, please visit us at {{shopUrl}}",
"zh_tw": "你好😊,觀迎打開{{shopName}},為平淡生活帶來甜蜜驚喜👙! \n\n你今日想睇啲咩啊?\n{{greetingList}}"
},
"NEXT_PAGE": {
"en": "Next page",
"zh_tw": "下一頁"
},
"BACK_TO_FIRST_PAGE": {
"en": "Back to first page",
"zh_tw": "返回第一頁"
},
"OTHER_CHOICE": {
"en": "I want to check sth else",
"zh_tw": "我想睇其他野"
},
"OTHER_PRODUCT": {
"en": "I want to check other product",
"zh_tw": "我想搵其他野"
},
"PRODUCT_RECOMMENDATION_NAME": {
"en": "Surprise me",
"zh_tw": "今期熱賣"
},
"COLLECTION_NAME": {
"en": "Our product with love",
"zh_tw": "全部商品"
},
"PRODUCT_SEARCH_NAME": {
"en": "Tell me what you desire",
"zh_tw": "你的願望"
},
"RECENT_HAPPENING_NAME": {
"en": "Recent happenings",
"zh_tw": "最新消息"
},
"CUSTOMER_SERVICE_NAME": {
"en": "Contact our CS team",
"zh_tw": "聯絡客服"
},
"CS_KEYWORD": [
"CS",
"after sales"
],
"COMPLAIN_KEYWORD": [
"complaint",
"complain",
"投訴"
],
"PRODUCT_INFO": {
"en": "{{productName}}\n{{productPrice}}\n\n{{orderMessage}}",
"zh_tw": "{{productName}}\n{{productPrice}}\n\n{{orderMessage}}"
},
"VARIANT_PRICE": {
"en": "up",
"zh_tw": "以上"
},
"ADD_TO_CART": {
"en": "Add to cart",
"zh_tw": "加入購物車"
},
"ADD_TO_CART_SUCCEED": {
"en": "Product added successfully\n\nExisting item(s):\n{{otherProduct}}",
"zh_tw": "貨品已成功加入購物車\n\n現有貨品:\n{{otherProduct}}"
},
"GET_YOURS_NOW": {
"en": "Get yours NOW!",
"zh_tw": "立即購買"
},
"CHECK_OUT": {
"en": "Check out ({{numberOfItem}} item(s))",
"zh_tw": "立即付款 ({{numberOfItem}} 件貨品)"
},
"VARIANTS": {
"en": "Which style are you looking for?\n{{variantsList}}",
"zh_tw": "請問想要邊一款?\n{{variantsList}}"
},
"QUANTITY": {
"en": "How many item would you like to buy?",
"zh_tw": "請問想買幾多件?"
},
"FAIL_SAFE_LIMIT": 2,
"FAIL_SAFE_TREE": "",
"FAIL_SAFE_NODE_ID": "",
"SEND_ERROR_TREE": "",
"SEND_ERROR_NODE_ID": "",
"CS_TREE": "",
"CS_NODE_ID": "",
"COMPLAIN_TREE": "",
"COMPLAIN_NODE_ID": ""
}
Field | Mandatory | Content |
---|---|---|
API_VERSION | Yes | Shopify API Version (Must the same as private app API version in Shopify) |
DEFAULT_LANGUAGE | Yes | Default language of chatbot in Shopify flow |
MAIN_MENU_KEYWORD | No | Keyword for back to main menu |
AVAILABLE_LANGUAGES | Yes | Available language choices of the chatbot flow |
LANGUAGES_MAPPING | Yes | Mapping member's language settings to language in Shopify flow (Checking member's tempData.Shopify.customLanguage -> member.customLocale -> member.locale -> MISCELLANEOUS.DEFAULT_LANGUAGE of config map) The key of each object will be checked by regex with case-insensitive search i.e. (zh_)+ matches with zh_hk and zh_tw |
GREETING_MENU_MESSAGE | Yes | Greetings message in main menu (after user types "Hi/Hello") |
OTHER_CHOICE | Yes | Message in quick reply to check other choices |
OTHER_PRODUCT | Yes | Message in quick reply to check other products |
PRODUCT_RECOMMENDATION_NAME | Yes | Product recommendation flow name |
COLLECTION_NAME | Yes | Collection flow name |
PRODUCT_SEARCH_NAME | Yes | Product Search flow name |
RECENT_HAPPENING_NAME | Yes | Recent Happening flow name |
CUSTOMER_SERVICE_NAME | Yes | Customer service name. The customer service flow is defined by yourself. In our experience, it is usually connected to an external live chat system like Slack or Zendesk and many more choices. |
PREVIOUS_PAGE | Yes | Message text for redirecting user back to previous page |
NEXT_PAGE | Yes | Message text for redirecting user to the next page |
BACK_TO_MAIN_MENU | Yes | Message text for redirecting user back to main menu |
CS_KEYWORD | No | Keyword to customer service flow |
COMPLAIN_KEYWORD | No | Keyword to complain flow |
VARIANT_PRICE | Yes | Message included in product which has multiple variants |
ADD_TO_CART | Yes | Message text for redirecting user to add product to cart |
ADD_TO_CART_SUCCEED | Yes | Successful add to cart message - {{otherProduct}} : Existing product list in the shopping cart in Stella |
GET_YOURS_NOW | Yes | Message text for redirecting to Shopify Store product page directly |
CHECK_OUT | Yes | Message text for redirecting user to Shopify Store checkout (System will send the product list in the shopping cart from Stella to Shopify) |
VARIANTS | Yes | If your Shopify product has different variants (e.g. colour variants). You can set up the variant question text here. |
QUANTITY | Yes | You can let customer to choose the quantity of your Shopify products. You can set up the quantity question text here. |
FAIL_SAFE_LIMIT | No | Fail safe counter limit, larger than or equal to limit will redirect to fail safe flow |
FAIL_SAFE_TREE | No | Fail safe tree. You should create your own general fail safe tree separately and apply the tree ID here to connect to your Shopify Flow. Please also remember to add this fail safe tree to the channel. |
FAIL_SAFE_NODE_ID | No | Fail safe node composite id. You should create your own general fail safe tree separately and apply the node composite ID here to connect to your Shopify Flow. Please also remember to add this fail safe tree to the channel. |
SEND_ERROR_TREE | No | Error tree. You should create your own general error tree separately and apply the tree ID here to connect to your Shopify Flow. Please also remember to add this error tree to the channel. |
SEND_ERROR_NODE_ID | No | Error node id. You should create your own general error tree separately and apply the node composite ID here to connect to your Shopify Flow. Please also remember to add this error tree to the channel. |
CS_TREE | No | Customer service tree (You should create your own general tree separately) Having CS_TREE and CS_NODE_ID in configMap will add one more carousel in main menu to trigger redirect to customer service node. The customer service flow is defined by yourself. In our experience, it is usually connected to an external live chat system like Slack or Zendesk and many more choices. You can build your own live chat tree and connect with to your Shopify tree. Please remember to add the tree ID here and add this CS tree to channel. |
CS_NODE_ID | No | Customer service node composite id The customer service flow is defined by yourself. In our experience, it is usually connected to an external live chat system like Slack or Zendesk and many more choices. You can build your own live chat tree and connect with to your Shopify tree. Please remember to add the node composite ID here and add this CS tree to channel. |
COMPLAIN_TREE | No | Complain tree. You should create your own general tree for customer complaints separately and apply the tree ID here to connect to your Shopify Flow. Please also remember to add this complain tree to the channel. |
COMPLAIN_NODE_ID | No | Complain node composite id. You should create your own general tree for customer complaints separately and apply the node composite ID here to connect to your Shopify Flow. Please also remember to add this complain tree to the channel. |
Select "Done" and "Save" the tree.
See if you can produce the expected result.
Ending of Conversation Flow (FLOW_END)
What is Your Result?
- You can edit the ending of the conversation flow. It will allow you to customize the display text for contacting customer service, search for product, product recommendation and search by collection.
Procedure
- Edit FLOW_END part of the config map.
{
"END_MESSAGE": {
"en": "Looking for recommendation? {{CS}}!\n\nOr you can select below services:\n{{servicesList}}",
"zh_tw": "想知邊款最適合你?{{CS}}!\n\n你亦可以選擇:\n{{servicesList}}"
},
"END_MESSAGE_2": {
"en": "Do you wish to see our hottest items🔥?\n\n{{servicesList}}",
"zh_tw": "想唔想睇埋我哋嘅今期熱賣🔥?\n\n{{servicesList}}"
},
"CS": {
"en": "Looking for recommendation from our live agents💁🏻♀️? Type",
"zh_tw": "想問問我哋細心嘅真人客服💁🏻♀️?輸入"
},
"PREVIOUS_PAGE": {
"en": "Back to previous page",
"zh_tw": "上一頁"
},
"SEARCH_OTHER": {
"en": "Look for sth else",
"zh_tw": "繼續搜尋"
},
"SEARCH": {
"en": "Tell me what you desire",
"zh_tw": "你的願望"
},
"RECOMMENDATION": {
"en": "Surprise me",
"zh_tw": "今期熱賣"
},
"COLLECTION": {
"en": "Our product with love",
"zh_tw": "全部商品"
}
}
Field | Mandatory | Content |
---|---|---|
END_MESSAGE | Yes | The message text to indicate that the conversation flow has reached the end. - {{CS}} : Display the message text to redirect to customer service flow - {{servicesList}}: List options to trigger other conversation flow |
END_MESSAGE_2 | Yes | Another flow end message - {{servicesList}} : Other flow list |
CS | Yes | Message text to redirect to customer service flow |
PREVIOUS_PAGE | Yes | Message text for redirecting user back to previous page |
SEARCH | Yes | Quick reply text to redirect to normal product search flow |
SEARCH_OTHER | Yes | Message text to redirect to product search flow. You can customize this text to convey the meaning of searching the store's products again. |
RECOMMENDATION | Yes | Message text to redirect to product recommendation flow |
COLLECTION | Yes | Quick reply text to redirect to collection flow |
Select "Done" and "Save" the tree.
See if you can produce the expected result.
Please note that, if they customer has added a recommended product to cart, the ending flow will not include the recommendation option.
Product Recommendation (PRODUCT_RECOMMENDATION)
What is Your Result?
If user selects "Surprise Me" , some preset options will be displayed. In this case, the user selects "Romantic night", the product "Pure 5.5 Seamless Bikini" was presented.
Procedure
- Edit PRODUCT_RECOMMENDATION part of the config map. You can copy any
productId
in your Shopify Store and paste it to the appropriate content in this config map.
{
"RECOMMENDATION_LIST": [
{
"name": {
"en": "Adventurous 🦁",
"zh_tw": "華麗歷險 🦁"
},
"type": "Bra",
"selection": "random",
"productId": "6126874689704"
}
{
"name": {
"en": "Romantic night 💕",
"zh_tw": "浪漫今夜 💕"
},
"selection": "specific",
"productId": "6126874689704"
}
],
"LIST_MESSAGE": {
"en": "These are the beauties you should never miss😈 Pick one you like:\n\n{{productRecommendationList}}\n\n{{endMessage}}",
"zh_tw": "以下嘅貨品你絕對唔可以錯過😈:\n\n{{productRecommendationList}}\n\n{{endMessage}}"
},
"RESULT_PRODUCT_CAPTION": {
"en": "This is our best choice for you!\n{{productInfo}}",
"zh_tw": "呢樣係我哋嘅心水推介:\n{{productInfo}}"
},
"OTHER_OPTIONS": {
"en": "Do you wish to look for the other options?\n{{productRecommendationList}}\n\n{{endMessage}}",
"zh_tw": "不如睇埋其他熱門商品啊?\n{{productRecommendationList}}\n\n{{endMessage}}"
},
"RESULT_NOT_FOUND": {
"en": "Sorry, product recommendation not found",
"zh_tw": "我搵唔到你想要嘅貨品啊😭"
}
}
Field | Mandatory | Content |
---|---|---|
RECOMMENDATION_LIST | Yes | Array of product recommendations You can change the object in selection: - For random : this means chatbot would filter by the prodcut_type and randomly pick a product out of that type, in the above example, the product type is bra - specific: this means chatbot will use a specific productId to retrieve the corresponding product information name : The text for the type/name of the recommendation. (If there is no name , chatbot will display the text in type instead) type : The "product type" displayed in your store. |
LIST_MESSAGE | Yes | Message text before the product list is shown - {{productRecommendationList}} : the product list from your Shopify store- {{endMessage}} : message text to indicate next page & previous page |
RESULT_PRODUCT_CAPTION | Yes | Caption text before the product info - {{productInfo}}: the product info from your Shopify Store using the productInfo template configured above |
OTHER_OPTIONS | Yes | Message text for other options - {{productRecommendationList}} : the product list from your Shopify Store- {{endMessage}} : message text to indicate for next page & previous page |
RESULT_NOT_FOUND | Yes | Message text if the product is not found |
Select "Done" and "Save" the tree.
See if you can produce the expected result.
Please note that the product type can be customized in the product page of your store.
Search by Collection (COLLECTION)
What is Your Result?
- User can select a product collection (i.e. "Bra")
- The chatbot will reply with the relevant products under the selected collection.
- User can view the product.
Procedure
- Edit COLLECTION part of the config map. As our system will automatically retrieve all the collections from your Shopify Store, there is a minimum effort to customize this part. You can simply change the display text according to your own preference.
{
"LIST_MESSAGE": {
"en": "Check out product collections👗! Tell us what do you want to look at:\n\n{{collectionList}}\n\n{{endMessage}}",
"zh_tw": "以下係我哋嘅貨品目錄👗! 話比我哋知你想搵啲咩啊:\n\n{{collectionList}}\n\n{{endMessage}}"
},
"RESULT_CAPTION": {
"en": "{{collectionName}}\n{{collectionDescription}}\n\n{{productList}}\n\nCheck the full collections at {{collectionUrl}}",
"zh_tw": "{{collectionName}}\n{{collectionDescription}}\n\n{{productList}}\n\n於 {{collectionUrl}} 查看全部貨品~"
},
"RESULT_MORE_THAN_10_PRODUCT": {
"en": "and more!",
"zh_tw": "同埋更多精彩貨品!"
}
}
Field | Mandatory | Content |
---|---|---|
LIST_MESSAGE | Yes | Message text before the collection list; - {{collectionList}} : the collection list from your Shopify store - {{endMessage}} : message text to indicate for next page & previous page |
RESULT_CAPTION | Yes | The display text with the information of the selected Collection - {{collectionName}} : the collection name from your Shopify Store- {{collectionDescription}} : the collection description from your Shopify Store- {{productList}} : the product list under the selected collection - {{collectionUrl}}: the collection url |
RESULT_MORE_THAN_10_PRODUCT | Yes | This message text will be shown if there are more than 10 products. |
Select "Done" and "Save" the tree.
See if you can produce the expected result.
Please note that all the available collections will be displayed, and the display order of collections depends on Shopify's API resoponses.
Search Product by Keyword (PRODUCT_SEARCH)
What is Your Result?
User can type specific product keyword and the chatbot will display the products accordingly.
Procedure
- Edit PRODUCT_SEARCH part of config map
{
"GREETINGS": {
"en": "Tell us what you want by typing the keywords here💁🏻♀️!",
"zh_tw": "話比我哋知你想搵啲咩啊💁🏻♀️!"
},
"RESULT": {
"en": "Are you looking for:\n{{result}}",
"zh_tw": "你係唔係搵緊:\n{{result}}"
},
"FAIL_SAFE": {
"en": "Please enter correct number",
"zh_tw": "請輸入正確數字"
},
"CHOOSE_TAG": {
"en": "Are you searching for gentleman or lady?\n\n{{tagMessage}}",
"zh_tw": "請問係搵緊男士定女士衣物?\n\n{{tagMessage}}"
},
"GENTLEMAN": {
"en": "Gentleman 🕺🏼",
"zh_tw": "男士 🕺🏼"
},
"LADY": {
"en": "Lady 💃🏼",
"zh_tw": "女士 💃🏼"
},
"OUT_OF_STOCK": {
"en": "Sorry, product(s) is/are out of stock:\n{{outOfStockList}}\n\n{{endMessage}}",
"zh_tw": "唔好意思,以下嘅貨品無晒貨喇🙇🏻♀️:\n{{outOfStockList}}\n\n{{endMessage}}"
},
"NO_PRODUCT_FOUND": {
"en": "We cannot find what you are looking for😭\n\n{{endMessage}}",
"zh_tw": "我搵唔到你想要嘅貨品啊😭\n\n{{endMessage}}"
},
"VARIANTS": {
"en": "Which style are you looking for?\n{{variantsList}}",
"zh_tw": "請問想要邊一款?\n{{variantsList}}"
}
}
Field | Mandatory | Content |
---|---|---|
GREETINGS | Yes | The Greeting message when user activates the product search flow |
RESULT | Yes | Product search result - {{result}} : the product search result |
CHOOSE_TAG | Yes | Choose tag (Only apply to male or female tag) if the target product list has both male and female products |
GENTLEMAN | Yes | Male tag name |
LADY | Yes | Female tag name |
OUT_OF_STOCK | Yes | Message for the Out of stock product list ({{outOfStockList}} is the product list which is out of stock) |
NO_PRODUCT_FOUND | Yes | No product is found during product search |
VARIANTS | Yes | If your Shopify product has different variants (e.g. colour variants). You can set up the variant question text here. |
Select "Done" and "Save" the tree.
See if you can produce expected result.
Coupon Flow (COUPON)
What is Your Result?
User types the keyword to receive a coupon.
Procedure
- Edit COUPON part of config map
{
"KEYWORD": "sanuker",
"IMAGE_URL": "https://miro.medium.com/max/1400/1*mk1-6aYaf_Bes1E3Imhc0A.jpeg",
"IMAGE_ATTACHMENT_ID": "{{>COUPON_IMAGE_ATTACHMENT_ID}}",
"MESSAGE": "We got a small gift to you. [You may enjoy 5% discount on your first purchase]",
"CODE": "SS20"
}
Field | Mandatory | Content |
---|---|---|
KEYWORD | Yes | The keyword to trigger the system to send out a coupon |
IMAGE_URL | No | Image URL either IMAGE_URL or IMAGE_ATTACHMENT_ID is required |
IMAGE_ATTACHMENT_ID | No | WhatsApp Media ID; You can create this ID via the attachment ID uploader, which shortens the time to send an image out either IMAGE_URL or IMAGE_ATTACHMENT_ID is required |
MESSAGE | Yes | Message text before displaying the coupon code |
CODE | Yes | Coupon Code. You must create the discount code in Shopify first) |
Select "Done" and "Save" the tree.
See if you can produce the expected result.
Recent Happenings Flow (RECENT_HAPPENINGS)
What is Your Result?
User can check out the latest happenings of your Shopify store from the chatbot.
Procedure
- Edit RECENT_HAPPENINGS part of the config map and customize the content or the displayed product accordingly.
{
"NEW_PRODUCT_ID": "6117243715752",
"MESSAGE": {
"en": "Breaking news❗️{{productName}}({{productPrice}}) is arriving at Secret Wardrobe👙\n\n{{orderMessage}}",
"zh_tw": "最新消息❗️{{productName}}({{productPrice}}) 現正登錄私密衣櫃👙 \n\n{{orderMessage}}"
}
}
Field | Mandatory | Content |
---|---|---|
NEW_PRODUCT_ID | Yes | The Shopify's product id of any products you want to highlight in recent happeneings. |
MESSAGE | Yes | You can customize the message in recent happenings flow - {{productName}} : product name from your Shopify Store - {{productPrice}} : is the product price from your Shopify Store - {{orderMessage}} : is the order message from Stella |
Select "Done" and "Save" the tree.
See if you can produce the expected result.
Members-Get-Members Sharing Mechanism (MEMBER_GET_MEMBER)
What is Your Result?
- When user types "I want MGM", the chatbot will offer a code to the user. If the user's friend uses the code to buy a product, then the user will also receives a coupon.
- Upon successful coupon usage by user's friend, the user will receive a successful message as shown in the next part - Successful Member Referral.
Procedure
- Create a separate Tree and a Global Node with the text trigger "MGM".
- Toggle on "Redirect" and click on the "Advanced" tab. Paste the following code and edit the "tree ID" accordingly:
return new Promise((resolve, reject) => {
// Logic here...
resolve({
tree: "Insert your Shopify proxy tree ID here",
nodeCompositeId: "Wz2TtiIB9gZJSGWB",
runPreAction: true,
sendResponse: true,
runPostAction: true,
})
})
Save the Global Node and add to your WhatsApp Channel.
Go back to your "[Shopify] WhatsApp - Proxy Tree" and edit MEMBER_GET_MEMBER part of the config map.
{
"REFEREE_DISCOUNT": "-5",
"REFERRER_DISCOUNT": "-10",
"REFEREE_END_AFTER": 7,
"REFERRER_END_AFTER": 7,
"REFEREE_VALUE_TYPE": "percentage",
"REFERRER_VALUE_TYPE": "percentage",
"REFEREE_USAGE_LIMIT": null,
"REFERRER_USAGE_LIMIT": 1,
"COUPON_TITLE_PREFIX": "",
"PRICE_RULE_PROPERTIES": {
"allocation_method": "across",
"entitled_collection_ids": [],
"entitled_country_ids": [],
"entitled_product_ids": [],
"entitled_variant_ids": [],
"once_per_customer": true,
"prerequisite_quantity_range": {},
"prerequisite_shipping_price_range": {},
"prerequisite_subtotal_range": {},
"prerequisite_to_entitlement_purchase": {},
"customer_selection": "all",
"target_selection": "all",
"target_type": "line_item",
"usage_limit": null,
"prerequisite_product_ids": [],
"prerequisite_variant_ids": [],
"prerequisite_collection_ids": [],
"prerequisite_to_entitlement_quantity_ratio": {},
"allocation_limit": null
},
"SHARE_TO_FRIEND_MESSAGE_1": {
"en": "Lucky🌟! Invite your friends to purchase with a 5% discount! You will also reward 10% OFF for your next purchase (Upon successful purchase)!",
"zh_tw": "快閃活動🌟!用以下優惠代碼比朋友用95折購買心水貨品!成功購買後,你亦可以於下一次購買時享有9折優惠!"
},
"SHARE_TO_FRIEND_MESSAGE_2": {
"en": "Share this code to your friend now: {{couponCode}}",
"zh_tw": "立即分享優惠代碼:{{couponCode}}"
},
"SHARE_TO_FRIEND_MESSAGE_3": {
"en": "Note: The code can be used ONCE only❗️",
"zh_tw": "注意:此優惠代碼只能使用一次❗️"
}
}
Field | Mandatory | Content |
---|---|---|
REFEREE_DISCOUNT | Yes | Discount of the referee |
REFERRER_DISCOUNT | Yes | Discount of the referrer (After successful referral) |
REFEREE_END_AFTER | No | Days until the Referee's discount offer expires |
REFERRER_END_AFTER | No | Days until the Referrer's discount expires |
REFEREE_VALUE_TYPE | Yes | Referee discount type (percentage or fixed_amount). percentage means the discount code discounts a percentage from the marked price of the Shopify store's product; fixed_amount means the discount codes discounts a fixed amount of price from the marked price of the Shopify store's product |
REFERRER_VALUE_TYPE | Yes | Referrer discount type (percentage or fixed_amount). percentage means the discount code discounts a percentage from the marked price of the Shopify store's product; fixed_amount means the discount codes discounts a fixed amount of price from the marked price of the Shopify store's product |
REFEREE_USAGE_LIMIT | No | The number of times that the referee discount can be used |
REFERRER_USAGE_LIMIT | No | The number of times that the referrer discount can be used |
COUPON_TITLE_PREFIX | No | Prefix of the coupon title |
PRICE_RULE_PROPERTIES | Yes | Price rule of the coupon based on Shopify documentation |
SHARE_TO_FRIEND_MESSAGE_1 | No | Referral message part 1 |
SHARE_TO_FRIEND_MESSAGE_2 | Yes | Referral message part 2 ({{couponCode}} is generated from Shopify's API via Stella) |
SHARE_TO_FRIEND_MESSAGE_3 | No | Referral message part 3 |
Select "Done" and "Save" the tree.
See if you can produce the expected result.
Successful Member Referral (REFER_SUCCEED)
What is Your Result?
As mentioned in "Members-Get-Members Sharing Mechanism". When the user's friend used the code to purchase anything in the store, the user will also get a coupon too.
Procedure
- Edit REFER_SUCCEED part of the config map.
{
"ELEMENT_NAME": "shopify_refer_succeed",
"LANGUAGE_CODE": {
"customer_language": "target_language_code",
"en": "en",
"zh_HK": "zh_HK",
"zh_tw": "zh_HK"
},
"PARAMETERS": [
{
"default": "{{couponCode}}"
}
],
"LANGUAGE_POLICY": "deterministic",
"DISABLE_REFER_SUCCEED": false
}
Field | Mandatory | Content |
---|---|---|
ELEMENT_NAME | Yes | Whatsapp template name of the successful referral message |
LANGUAGE_CODE | Yes | Customer language map to WhatsApp template language code |
COMPONENTS | No | Components of the Whatsapp template - {{couponCode}} : coupon code generated for referer Either COMPONENTS or PARAMETERS is required for WhatsApp template |
PARAMETERS | No | Parameters of the Whatsapp template - {{couponCode}} : coupon code generated for referer Either COMPONENTS or PARAMETERS is required for WhatsApp template |
LANGUAGE_POLICY | Yes | WhatsApp template's language policy |
DISABLE_REFER_SUCCEED | No | You can disable this feature if it is marked as true |
Select "Done" and "Save" the tree.
See if you can produce the expected result.
Order Confirmation (ORDER_CREATE)
What is Your Result?
- User checks out in your Shopify Store and enters user's WhatsApp number.
- User receives an order confirmation message on WhatsApp.
Procedure
- Edit ORDER_CREATE part of the config map.
{
"ELEMENT_NAME": "shopify_order_confirmation",
"LANGUAGE_CODE": {
"customer_language": "whatsapp template language code",
"en": "en",
"zh_HK": "zh_TW",
"zh_tw": "zh_HK"
},
"COMPONENTS": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "{{firstName}}"
},
{
"type": "text",
"text": "{{orderId}}"
}
]
},
{
"type": "button",
"sub_type": "url",
"index": "0",
"parameters": [
{
"type": "text",
"text": "{{order_status_url}}"
}
]
}
],
"LANGUAGE_POLICY": "deterministic",
"SYSTEM_ORDER_CREATION_TREE": "",
"SYSTEM_ORDER_CREATION_NODE_ID": "",
"DISABLE_ORDER_CONFIRMATION": false
}
Field | Mandatory | Content |
---|---|---|
ELEMENT_NAME | Yes | WhatsApp template name for order confirmation |
LANGUAGE_CODE | Yes | Customer's language is mapped to WhatsApp template's language code, so that the languages are synced |
COMPONENTS | No | Components of order confirmation's WhatsApp template - {{firstName}} : the first name of the customer name - {{orderId}} : order id of the items ordered by user in Shopify - {{order_status_url}} : the url showing order status for the items oredered by user in Shopify Either COMPONENTS or PARAMETERS is required for WhatsApp template |
PARAMETERS | No | Parameters of order confirmation's Whatsapp template - {{firstName}} : the first name of the customer name - {{orderId}} : order id of the items ordered by user in Shopify - {{order_status_url}} : the url showing order status for the items oredered by user in Shopify Either COMPONENTS or PARAMETERS is required for WhatsApp template |
LANGUAGE_POLICY | Yes | Order confirmation WhatsApp template's language policy |
SYSTEM_ORDER_CREATION_TREE | No | Tree ID to pass data to external tree if user did not provide WhatsApp number |
SYSTEM_ORDER_CREATION_NODE_ID | No | Node composite ID to pass data to external tree if user did not provide WhatsApp number |
DISABLE_ORDER_CONFIRMATION | No | You can disable this feature if it is marked as true |
Select "Done" and "Save" the tree.
See if you can produce the expected result.
Order Update (ORDER_UPDATE)
What is Your Result?
- User can receive an order update message from WhatsApp.
- User can click the URL button and view the shipping status.
Procedure
- Edit ORDER_UPDATE part of config map
{
"ELEMENT_NAME": "shopify_order_update_v5",
"LANGUAGE_CODE": {
"en": "en",
"zh_HK": "zh_HK",
"zh_tw": "zh_HK"
},
"COMPONENTS": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "{{firstName}}"
},
{
"type": "text",
"text": "{{orderId}}"
},
{
"type": "text",
"text": "{{trackingCompany}}"
},
{
"type": "text",
"text": "{{trackingNumber}}"
}
]
},
{
"type": "button",
"sub_type": "url",
"index": "0",
"parameters": [
{
"type": "text",
"text": "{{trackingUrl}}"
}
]
}
],
"LANGUAGE_POLICY": "deterministic",
"SYSTEM_ORDER_UPDATE_TREE": "",
"SYSTEM_ORDER_UPDATE_NODE_ID": "",
"DISABLE_ORDER_UPDATE": false
}
Field | Mandatory | Content |
---|---|---|
ELEMENT_NAME | Yes | WhatsApp template name for order updates |
LANGUAGE_CODE | Yes | Customer's language is mapped to WhatsApp template's language code, so that the languages are synced |
COMPONENTS | No | Components of order updates' WhatsApp template - {{firstName}} : the first name of the customer name - {{orderId}} : order id of the items ordered by user in Shopify - {{trackingCompany}} : tracking company used for the order - {{trackingNumber}} : tracking number or user's order - {{trackingUrl}} : tracking url of user's order Either COMPONENTS or PARAMETERS is required for WhatsApp template |
PARAMETERS | No | Parameters of order updates' WhatsApp template - {{firstName}} : the first name of the customer name - {{orderId}} : order id of the items ordered by user in Shopify - {{trackingCompany}} : tracking company used for the order - {{trackingNumber}} : tracking number or user's order - {{trackingUrl}} : tracking url of user's order Either COMPONENTS or PARAMETERS is required for WhatsApp template |
LANGUAGE_POLICY | Yes | Order updates WhatsApp template's language policy |
SYSTEM_ORDER_CREATION_TREE | No | Tree ID to pass data to external tree if user did not provide WhatsApp number |
SYSTEM_ORDER_CREATION_NODE_ID | No | Node composite ID to pass data to external tree if user did not provide WhatsApp number |
DISABLE_ORDER_CONFIRMATION | No | You can disable this feature if it is marked as true |
Select "Done" and "Save" the tree.
See if you can produce the expected result.
Payment Confirmation Flow (PAYMENT_CONFIRMATION)
What is Your Result?
- Create an order manually from the Shopify Store admin panel and completes the payment.
- An order & payment confirmation message can be sent to user.
Procedure
- Edit PAYMENT_CONFIRMATION part of the config map.
{
"ELEMENT_NAME": "shopify_order_payment_confirmation",
"LANGUAGE_CODE": {
"customer_language": "whatsapp template language code",
"en": "en",
"zh_HK": "zh_TW",
"zh_tw": "zh_HK"
},
"PARAMETERS": [
{
"default": "{{firstName}}"
},
{
"default": "{{orderId}}"
}
],
"LANGUAGE_POLICY": "deterministic",
"SYSTEM_PAYMENT_CONFIRMATION_TREE": "",
"SYSTEM_PAYMENT_CONFIRMATION_NODE_ID": "",
"DISABLE_PAYMENT_CONFIRMATION": false
}
Field | Mandatory | Content |
---|---|---|
ELEMENT_NAME | Yes | WhatsApp template name for payment confirmation |
LANGUAGE_CODE | Yes | Customer's language is mapped to WhatsApp template's language code, so that the languages are synced |
COMPONENTS | No | Components of payment confirmation's WhatsApp template - {{firstName}} : the first name of the customer name - {{orderId}} : order id of the items ordered by user in Shopify - {{trackingCompany}} : tracking company used for the order - {{trackingNumber}} : tracking number or user's order - {{trackingUrl}} : tracking url of user's order Either COMPONENTS or PARAMETERS is required for WhatsApp template |
PARAMETERS | No | Parameters of payment confirmation's WhatsApp template - {{firstName}} : the first name of the customer name - {{orderId}} : order id of the items ordered by user in Shopify - {{trackingCompany}} : tracking company used for the order - {{trackingNumber}} : tracking number or user's order - {{trackingUrl}} : tracking url of user's order Either COMPONENTS or PARAMETERS is required for WhatsApp template |
LANGUAGE_POLICY | Yes | Payment confirmation WhatsApp template's language policy |
SYSTEM_ORDER_CREATION_TREE | No | Tree ID to pass data to external tree if user did not provide WhatsApp number |
SYSTEM_ORDER_CREATION_NODE_ID | No | Node composite ID to pass data to external tree if user did not provide WhatsApp number |
DISABLE_ORDER_CONFIRMATION | No | You can disable this feature if it is marked as true |
Select "Done" and "Save" the tree.
See if you can produce the expected result.
Part 3 - Global Node Trigger Table
Here is the table of all the nodes' priority and triggers for your reference. If you are adding any other general tree to the channel, please make sure they do not have any conflict with the Shopify tree. For details in node matching & priority, please refer here.
Trigger type (extra requirement) | Priority | Function |
---|---|---|
config.MISCELLANEOUS.MAIN_MENU_KEYWORD TEXT(set in config) | 10 | Redirect to Main Menu |
Any TEXT | 11 | If user input is the product name, the chatbot will display the product directly. If the member's fail safe count is larger than FAIL_SAFE_LIMIT in config map, chatbot will redirect to the targeted fail safe tree. Otherwise, the chatbot will redirect to the Main Menu |
config.COUPON.KEYWORD TEXT (enabled coupon flow) | 10 | Redirect to coupon flow |
config.CUSTOMER_CARE_OPT_OUT_KEYWORD TEXT | 10 | Unsubscribe customer care messages |
config.CUSTOMER_CARE_OPT_IN_KEYWORD TEXT | 10 | Subscribe customer care messages |
config.MISCELLANEOUS.CS_KEYWORD TEXT (set in config) | 10 | Redirect to customer service tree (external tree) |
config.MISCELLANEOUS.COMPLAIN_KEYWORD TEXT (set in config) | 10 | Redirect to complain tree (external tree) |
Redirect to Customer Service
In the table above, pre-sales PAYLOAD and config.MISCELLANEOUS.CS_KEYWORD TEXT allows your users to trigger the customer service flow. If you want to make use of it, you will need a few more steps to set it up.
The customer service tree is not included in the config map. Therefore, you have to first build an external tree for the customer service flow.
After that, insert the treeID and nodeID of your customer service tree into the config map. Normally, the "CS_TREE" and "CS_NODE_ID" are located at line 100.
- Once you have added the treeID and nodeID to the config map, a new option for the CS flow will be displayed on the menu
- You can edit the displayed text at "CUSTOMER_SERVICE_NAME". It is normally located at line 51.