conversational commerce and magento 2: breaking new ground with facebook, alexa, and slack
TRANSCRIPT
Conversational Commerce and Magento 2
Breaking new ground with Alexa, Facebook and Slack
Conversational Commerce: Magento, Facebook and Alexa | October 2016 1
@philwinklegithub.com/philwinkle
Conversational Commerce: Magento, Facebook and Alexa | October 2016 2
What is Conversational Commerce?
(C12L)
Conversational Commerce: Magento, Facebook and Alexa | October 2016 6
What is it not?
C12L is not about shopping online in a chat bot. It is about creating opportunities to engage with customers in an asynchronous way
Conversational Commerce: Magento, Facebook and Alexa | October 2016 7
So then what is Conversational Commerce?
— Conversational, when done well, is assistive
— It is engaging
— It is helpful
— It creates value
Conversational Commerce: Magento, Facebook and Alexa | October 2016 8
C12L Commerce
This is not a new concept. "Bots" have been around for ages. What is new is that we can now interact with them outside of our traditional desktop computer contexts.
Conversational Commerce: Magento, Facebook and Alexa | October 2016 9
We shouldn't be repurposing APIs for every medium. Each
medium excels in its own particular niche given its
audience.
Conversational Commerce: Magento, Facebook and Alexa | October 2016 10
— Not for all contexts
— Alexa: Store Insights / Administration
— Slack: Developer Support
— Facebook: Consumer
Conversational Commerce: Magento, Facebook and Alexa | October 2016 11
Why not Alexa for purchasing on Magento?
— API could be used, so it's possible
— Purchase decisions are hard
— Predciated on choice
— Search and browse is impossible via spoken word
— Write one API, use it many places...
Conversational Commerce: Magento, Facebook and Alexa | October 2016 12
Why would we want this?
— We're moving away from Visual UI
— Spoken word is the fastest way to communicate (send)
— Written text is the fastest way to consume
Conversational Commerce: Magento, Facebook and Alexa | October 2016 13
We're becoming increasingly distracted
Conversational Commerce: Magento, Facebook and Alexa | October 2016 14
What kind of change does this mean for businesses?
— Change of jobs and expertise
— Fewer creative arts, more communications
— Call trees replaced by chat trees
— Asynchronous, on your time === 24/7
Conversational Commerce: Magento, Facebook and Alexa | October 2016 15
Obvious commerce applications
— Beyond the purchase:
— Status, update, cancel, replacement
— Reorder
— 1-click, ephemeral
Conversational Commerce: Magento, Facebook and Alexa | October 2016 16
Challenges
— Fragmented APIs mean lots of boilerplate code to interact with your store capabilities
— For Magento this is likely REST API
— Different UIs mean different skillsets
Conversational Commerce: Magento, Facebook and Alexa | October 2016 18
Alexa
Upside:
— Robust API
— Geared toward commerce (future)
— Rapid dev
— 3rd party consumer
— FREE (Raspberry Pi)
— BYOL(anguage)Conversational Commerce: Magento, Facebook and Alexa | October 2016 21
Alexa (cont.)
Downside:
— Physical devices (right now)
— Lower adoption with dependence on physical devices
Conversational Commerce: Magento, Facebook and Alexa | October 2016 22
Thankfully
— Serverless.js
— Alexa App on Node.js
Conversational Commerce: Magento, Facebook and Alexa | October 2016 23
Developer boilerplate without Alexa App:
exports.handler = (event, context, callback) => { try { console.log(`event.session.application.applicationId=${event.session.application.applicationId}`);
/** * Uncomment this if statement and populate with your skill's application ID to * prevent someone else from configuring a skill that sends requests to this function. */ /* if (event.session.application.applicationId !== 'amzn1.echo-sdk-ams.app.[unique-value-here]') { callback('Invalid Application ID'); } */
if (event.session.new) { onSessionStarted({ requestId: event.request.requestId }, event.session); }
if (event.request.type === 'LaunchRequest') { onLaunch(event.request, event.session, (sessionAttributes, speechletResponse) => { callback(null, buildResponse(sessionAttributes, speechletResponse)); }); } else if (event.request.type === 'IntentRequest') { onIntent(event.request, event.session, (sessionAttributes, speechletResponse) => { callback(null, buildResponse(sessionAttributes, speechletResponse)); }); } else if (event.request.type === 'SessionEndedRequest') { onSessionEnded(event.request, event.session); callback(); } } catch (err) { callback(err); }};
Conversational Commerce: Magento, Facebook and Alexa | October 2016 24
With Alexa App:
'use strict';
var rp = require('request-promise');var alexa = require('alexa-app');var app = new alexa.app('sample');var options = require('config');
app.intent('SalesVolumeIntent', function(request, response) {
options.uri = 'http://c12l.philwinkle.com/index.php/rest/V1/admin/sales/totals/today';
rp(options) .then(function (res) { response.say("Your sales for today are currently " + res.grand_total + " dollars"); response.send(); });
return false;});
exports.handler = app.lambda();
Conversational Commerce: Magento, Facebook and Alexa | October 2016 25
Siri
Upside:
— Billions of devices (literally)
— Soon in our ears (thanks Airpods)
Downside:
— Swift / App dev focus
Conversational Commerce: Magento, Facebook and Alexa | October 2016 26
Utterances
Utterances is the phrase that maps to an intent to process a request
CheckStoreOnline is my store onlineCheckStoreOnline are you onlineCheckStoreOnline if it is onlineCheckStoreOnline statusCheckStoreOnline current status
Conversational Commerce: Magento, Facebook and Alexa | October 2016 29
Intents and Slots
An intent allows you to map a phrase or phrases to a static function
CheckStockLevel how many {item} are in stockCheckStockLevel how many {color} {item} are in stockCheckStockLevel how many {item} do I haveCheckStockLevel how many {color} {item} do I haveCheckStockLevel what is the stock level of {item}CheckStockLevel what is the stock level of {color} {item}
Conversational Commerce: Magento, Facebook and Alexa | October 2016 30
Skill
A skill is a group of utterances which represent common functionality. Essentially, an "app", for Alexa.
Conversational Commerce: Magento, Facebook and Alexa | October 2016 31
Serverless = Stateless
Because Alexa runs Lambda functions it is inherently stateless. State can be stored either- as a long-running session with multi-step question and answer workflows- stored in DynamoDb for later retrieval
Conversational Commerce: Magento, Facebook and Alexa | October 2016 33
Interesting endpoints to consume for logged-in customers:
Quote REST API:
GET /V1/carts/mineGET /V1/carts/mine/itemsGET /V1/carts/mine/payment-methodsGET /V1/carts/mine/selected-payment-methodGET /V1/carts/mine/shipping-methodsGET /V1/carts/mine/totals
Conversational Commerce: Magento, Facebook and Alexa | October 2016 36
Use tokens for customer-authenticated REST
Conversational Commerce: Magento, Facebook and Alexa | October 2016 37
Generate a token:
/rest/V1/integration/customer/token
Conversational Commerce: Magento, Facebook and Alexa | October 2016 38
Example:
curl -X "POST" "http://c12l.philwinkle.com/index.php/rest/V1/integration/customer/token" \ -H "Content-Type: application/json" \ -d $'{"username":"[email protected]", "password":"asdf;lkj1234"}'
Conversational Commerce: Magento, Facebook and Alexa | October 2016 39
Get cart totals:
curl -X "GET" "http://c12l.philwinkle.com/index.php/rest/V1/carts/mine" \ -H "Authorization: Bearer 3g43lph2w0lcfh6719ltaa0fiml6sma1" \ -H "Content-Type: application/json"
Conversational Commerce: Magento, Facebook and Alexa | October 2016 40
Things that help
— Having an Alexa Device
— https://echosim.io/
— Testing tools in AWS Lambda Available
— Testing tools in Developer Portal
— Paw / REST testing tool
Conversational Commerce: Magento, Facebook and Alexa | October 2016 41
Messenger
Messenger's approach is vastly different and is essentially the same experience as creating a
Conversational Commerce: Magento, Facebook and Alexa | October 2016 43
Upsides
— Fit for commerce
— Cards
— Long interactions
— Initiate / Push
— Customer Matching (phone #)
— Can use any language
— XMPP should be familiarConversational Commerce: Magento, Facebook and Alexa | October 2016 44
Downsides
— XMPP is limiting, requires persistence
— We emulate more human-like qualities via text so we have to fake interactions and pauses
Conversational Commerce: Magento, Facebook and Alexa | October 2016 45
Top 3 tips to creating engaging bot experiences1
1. Don't be dense
2. Have a vibe
3. Speak, don't print
1 GARY LEVITT, YOLA; VENTUREBEAT SEPTEMBER 2016
Conversational Commerce: Magento, Facebook and Alexa | October 2016 46
1. Don't be dense
Bad:
Me: help.
Bot: I can help by answering simple questions about how Chatbot works. I’m just a bot, though! If you need more help, try our Help Center for loads of useful information about Chatbot...```
Conversational Commerce: Magento, Facebook and Alexa | October 2016 47
1. Don't be dense
Better
Me: help.
Bot: Help is here, Gary!
Bot is typing…
Bot: Ask me a simple question.
Me: how to I blah blah blah?Conversational Commerce: Magento, Facebook and Alexa | October 2016 48
Don't be dense
1. Constructing a concise chronological narrative helps reduce denseness. When content is in little chunks, it’s easier to process.
2. When your chatbot provides the right forms and buttons at the right time, it can outperform its visual interface counterpart.
3. Combining concepts or distinct sets of details in one response causes mental static, and should be
Conversational Commerce: Magento, Facebook and Alexa | October 2016 49
Have a Vibe
1. Break up your communication into parts based on their functions: actions, greetings, goodbyes, thankyous, updates, loading, processing, intros, descriptions, notifications, etc.
2. Pick one or two parts and — while keeping all other parts neutral, concise, and direct — make that part a little zesty or animated.
Conversational Commerce: Magento, Facebook and Alexa | October 2016 51
3. Speak, don’t print
In short, emulate typing and build in pauses. You can split-test engagement based on pause time for a more data-centric approach.
Conversational Commerce: Magento, Facebook and Alexa | October 2016 52
Messenger Differentiators
The key differentiators for Messenger are:
— A robust interaction platform:
— Card types
— Media
— Video
— Interaction
Conversational Commerce: Magento, Facebook and Alexa | October 2016 54
Downsides
— No discernment of "intent" like in Alexa
— Developer left to parse intent from AI human language engine
Conversational Commerce: Magento, Facebook and Alexa | October 2016 55
Push a message
Your package has shipped
curl -X POST -H "Content-Type: application/json" -d '{ "recipient":{ "id":"USER_ID" }, "message":{ "text":"hello, world!" }}' "https://graph.facebook.com/v2.6/me/messages?access_token=PAGE_ACCESS_TOKEN"
Conversational Commerce: Magento, Facebook and Alexa | October 2016 60