In this presentation given at ZendCon 2016 I detail the approach to building worthwhile conversational commerce experiences for Alexa and Facebook Messenger on Magento 2.
Conversational Commerce and Magento 2: Breaking new ground with Facebook, Alexa, and Slack
1. Conversational Commerce
and Magento 2
Breaking new ground with Alexa,
Facebook and Slack
Conversational Commerce: Magento, Facebook and Alexa | October 2016 1
7. 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
8. 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
9. 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
10. 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
11. — Not for all contexts
— Alexa: Store Insights / Administration
— Slack: Developer Support
— Facebook: Consumer
Conversational Commerce: Magento, Facebook and Alexa | October 2016 11
12. 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
13. 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
15. 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
16. Obvious commerce applications
— Beyond the purchase:
— Status, update, cancel, replacement
— Reorder
— 1-click, ephemeral
Conversational Commerce: Magento, Facebook and Alexa | October 2016 16
18. 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
24. 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
25. 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
26. 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
29. Utterances
Utterances is the phrase that maps to an intent to
process a request
CheckStoreOnline is my store online
CheckStoreOnline are you online
CheckStoreOnline if it is online
CheckStoreOnline status
CheckStoreOnline current status
Conversational Commerce: Magento, Facebook and Alexa | October 2016 29
30. Intents and Slots
An intent allows you to map a phrase or phrases to a
static function
CheckStockLevel how many {item} are in stock
CheckStockLevel how many {color} {item} are in stock
CheckStockLevel how many {item} do I have
CheckStockLevel how many {color} {item} do I have
CheckStockLevel 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
31. 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
33. 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
35. Magento 2 REST APIs
Conversational Commerce: Magento, Facebook and Alexa | October 2016 35
36. Interesting endpoints to consume for logged-in
customers:
Quote REST API:
GET /V1/carts/mine
GET /V1/carts/mine/items
GET /V1/carts/mine/payment-methods
GET /V1/carts/mine/selected-payment-method
GET /V1/carts/mine/shipping-methods
GET /V1/carts/mine/totals
Conversational Commerce: Magento, Facebook and Alexa | October 2016 36
37. Use tokens for customer-
authenticated REST
Conversational Commerce: Magento, Facebook and Alexa | October 2016 37
40. 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
41. 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
43. 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
44. Upsides
— Fit for commerce
— Cards
— Long interactions
— Initiate / Push
— Customer Matching (phone #)
— Can use any language
— XMPP should be familiar
Conversational Commerce: Magento, Facebook and Alexa | October 2016 44
45. 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
46. 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
47. 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
48. 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
49. 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
50. 2. Have a Vibe
Conversational Commerce: Magento, Facebook and Alexa | October 2016 50
51. 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
52. 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
54. 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
55. 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