SlideShare a Scribd company logo
#MM18PL#MM18PL
Integrating voice search in
Magento 2 using Web
Speech API
Adrian Bece | @AdrianBDesigns
#MM18PL#MM18PL
Adrian Bece
● Working at Inchoo since 2015
● React Developer
● Certified Magento 1 Frontend Developer
● Worked on various Magento 1 and Magento 2 projects for international clients
● Worked on numerous personal React projects
@AdrianBDesigns | codeadrian.github.io
#MM18PL#MM18PL
“Voice commerce represents the next major disruption in
the retail industry (…) The speed with which consumers
are adopting smart speakers will translate into a number
of opportunities and even more challenges for traditional
retailers and consumer products companies.”
- John Franklin, OC&C (December 2017)
#MM18PL#MM18PL
Voice Shopping & Home assistants
● People are getting more accustomed to Voice Shopping (Smart Speaker / Home
Assistants)
● Amazon dominates the Home assistant market with Echo device (68%)
● In late 2017, Walmart has teamed with Google to offer Voice Shopping
● Most commonly shopped categories through voice:
Groceries (20%), Entertainment (19%), Electronics (17%), Clothing (8%) *
● Voice purchases tend to be stand-alone, lower value items *
● Prediction: Voice Shopping Market in US to grow from $2 billion to $40 billion in 2022 *
* OC&C Strategy Consultants Study (December 2017)
#MM18PL#MM18PL
Voice Shopping & Home assistants - concerns
● Not convenient for obtaining information about product (attributes, description, price, etc.)
● Product keywords might change → voice search results might change
● 2% of the people who use Amazon’s Echo have made a purchase with their voices in 2018 *
● Of the people who used voice shopping, most people didn’t use Voice shopping again *
● People who did use Voice Shopping again, used it more extensively (searching, tracking
orders, etc.) *
● Amazon tries to encourage Voice Shopping by offering discounts and better deals
● There is potential in Voice Shopping, but there is no established pattern which is familiar to
users
* Anonymous Sources (Amazon insider info) for “The Information” (August 2018)
#MM18PL#MM18PL
What about regular
Web browsers?
#MM18PL#MM18PL
Browser Voice Search Potential
● Google Voice Search queries has grown 7x since 2010
● Android - 1 of 5 searches are done by voice (US)
● Baidu - 1 of 10 searches are done by voice
● 1 of 3 users use voice recognition technology on their device daily
● Number of voice searches expected to continue growing
● Prediction: 50% of searches will be done by voice by 2020.
#MM18PL#MM18PL
Web Speech API
● Provides speech-input and text-to-speech functionality in a web browser
● Web apps are able to handle voice data
● Interesting new possibilities for accessibility and control mechanisms
● Features which are not typically available when using standard software
● Experimental technology
● Two main parts
● Speech Recognition API
● provides ability to recognize voice from an audio input
● Speech Synthesis API
● provides ability to read out the text content
#MM18PL#MM18PL
Speech Recognition API (63% global browser support)
#MM18PL#MM18PL
Speech Synthesis API (80% global browser support)
#MM18PL#MM18PL
Speech Recognition API
● It requires internet connection to work on Chrome
● HTTPS only - can be avoided if specific flag is set when running Chrome
● It requires a config flag to be set in Firefox
● Properties
● Grammar, Language, Single / Multiple Results, Final / Interim Results
● Events
● Audio start, Audio end, On error, On result, On speech start, On speech end, etc.
● Methods
● Starting speech recognition, Stopping with returning a result, Stopping without returning a
result
#MM18PL#MM18PL
Speech
Recognition Data
• Settings
• Interim Results
• Single Result
• Returns
• Confidence
• Transcript
#MM18PL#MM18PL
Voice recognition can be used for dictating text in a form field,
as well as navigating to and activating links, buttons, and other
controls. (…) Some voice recognition tools allow complete
control over computer interaction, allowing users to scroll the
screen, copy and paste text, activate menus, and perform other
functions.
- W3C Web Accessibility Initiative on “Voice Recognition”
#MM18PL#MM18PL
Accessibility
● Who benefits from the Speech Recognition functionality?
● People with physical disabilities who cannot use the keyboard or mouse.
● People with chronic conditions who need to limit or avoid using the keyboard or
mouse.
● People with cognitive and learning disabilities who need to use voice rather than to
type.
● People with temporary limitations, such as a broken arm.
● People who prefer to speak rather than type (Depends on the device type,
situation, personal preference, etc.)
#MM18PL#MM18PL
web/js/
voiceSearch.js
• General Structure
• Options
• Setup
• Functions
• Event Listeners
• Support Functions
define([
'jquery',
'mage/translate',
'domReady!'
], function ($) {
'use strict';
$.fn.voiceSearch = function (options) {
/***********
* OPTIONS *
***********/
/*********
* SETUP *
*********/
/*************
* FUNCTIONS *
*************/
};
return function (config, node) {
$(node).voiceSearch(config);
}
});
#MM18PL#MM18PL
web/js/
voiceSearch.js
• Options Section
var defaults = {
"placeholderText": "Listening...",
"speechRecognitionTrigger": "#voice-search-
trigger",
"formInput": "#search"
},
$formElement = $(this);
options = $.extend(defaults, options);
$formElement = $(this);
var recognition = null;
var isActive = false;
var speechRecognitionTrigger =
$(options.speechRecognitionTrigger),
$formInput = $(options.formInput),
placeholderText =
$.mage.__(options.placeholderText);
window.SpeechRecognition = window.SpeechRecognition
|| window.webkitSpeechRecognition;
#MM18PL#MM18PL
web/js/
voiceSearch.js
• Setup Section
if (window.SpeechRecognition) {
recognition = new
SpeechRecognition();
recognition.interimResults = true;
this.setupRecognitionListeners();
this.setupVoiceSearchButton();
recognition.onresult =
this.handleOnResult.bind(this);
} else {
speechRecognitionTrigger.hide();
}
#MM18PL#MM18PL
web/js/
voiceSearch.js
• Functions Section
• Event Listeners
this.setupVoiceSearchButton = function () {
speechRecognitionTrigger.on('click touch',
this.startListening);
};
this.setupRecognitionListeners = function () {
recognition.onstart = function () {
isActive = true;
};
recognition.onend = function () {
isActive = false;
};
recognition.onerror = function () {
isActive = false;
};
};
#MM18PL#MM18PL
web/js/
voiceSearch.js
• Functions Section
• Support Functions
this.parseTranscript = function (e) {
return Array.from(e.results).map(
function (result) {
return result[0]
}).map(
function (result) {
return result.transcript
}).join('');
};
this.startListening = function (e) {
e.preventDefault();
if(!isActive) {
$formInput.val('');
$formInput.attr("placeholder", placeholderText);
recognition.start();
}
};
this.handleOnResult = function (e) {
$formInput.val(this.parseTranscript(e).toLowerCase());
if (e.results[0].isFinal) {
$formElement.submit();
}
};
#MM18PL#MM18PL
requirejs-config.js
• Standard mapping
var config = {
map: {
'*': {
'voiceSearch': 'js/voiceSearch'
}
}
};
#MM18PL#MM18PL
Magento_Search/templat
es/form.mini.phtml
• Add a call to the <form> element
• Add voice search <button>
• Add some id-s if necessary
• Call the voiceSearch
• Default parameters
• Custom parameters
(…)
<form
class="form minisearch"
id="search_mini_form"
action="<?= /* @escapeNotVerified */
$helper->getResultUrl() ?>"
method="get"
data-mage-init=‘{"voiceSearch":{}}'>
(…)
<button class="action search voice"
id=“voice-search-trigger"></button>
(…)
(…)
#MM18PL#MM18PL
#MM18PL#MM18PL
Result -
Page Load
• If Web Speech API is not supported, Voice search
button will be hidden
• User will be prompted to confirm microphone
permission
• After user grands permission, the text input
placeholder will change to “Listening…”
#MM18PL#MM18PL
Result - Search
Action
• After user has finished speaking, text will be added
to the search input form
• Form submits and user is redirected to Magento 2
search results page
• User can click again on the Voice Search button
and perform search from the beginning
#MM18PL#MM18PL
Areas Of Improvement
● Confirm the input before submitting the form
● Cancel voice search if input is not received in some time limit
● Check if the confidence of the result is above certain percentage before submitting.
If percentage is lower than the threshold, ask user to repeat the voice search.
● UX improvement - Better communication of current state (recording, submitting
form, etc.)
● Open the product page for the first search result instead of search result page
● Use Google Cloud Speech-to-Text (paid) to enable language recognition and allow
users to search in their native language.
#MM18PL#MM18PL
Additional Ideas
● Voice-controlled shopping
● Search, selecting products
● Selecting quantity, configuring, adding to cart
● Navigating to cart and checkout
● Voice-controlled On-screen assistant
● Speech Synthesis API
● Improved accessibility, voice-controlled shortcuts
● Voice-controlled shopping, contact forms, chat support, shortcuts, etc.
#MM18PL#MM18PL
There might be very few voice shoppers right
now… but once you find out what’s special
about them, you can grow them very quickly.
That’s an unresolved problem.
- The Information, “The Reality Behind Voice Shopping Hype”
(August 2018)
#MM18PL#MM18PL
Conclusion
● People are still getting accustomed to Voice Shopping (home assistants and smart speakers)
● Voice search continues to grow across various desktop and mobile devices
● Web Speech API opens the door for speech recognition from a Web Browser (it’s still
experimental)
● Beneficial for accessibility, also has potential for regular use
● Consider adding the functionality in stages and monitor how customers are using it
● Are they using it for product discovery or shop for familiar items?
● Are they using it more on mobile because it’s easier?
● Which voice-controlled functionalities are they using more and which they are using
less?
#MM18PL#MM18PL
Thank you for your
attention.
Adrian Bece | @AdrianBDesigns

More Related Content

Similar to Integrating Voice Search in Magento 2 Using Web Speech API - Adrian Bece

A Tale of Two Case Studies: Using LLMs in Production
A Tale of Two Case Studies: Using LLMs in ProductionA Tale of Two Case Studies: Using LLMs in Production
A Tale of Two Case Studies: Using LLMs in Production
Aggregage
 
Giving Marketing a Voice: 10 Steps for Marketing with Voice Assistants
Giving Marketing a Voice: 10 Steps for Marketing with Voice AssistantsGiving Marketing a Voice: 10 Steps for Marketing with Voice Assistants
Giving Marketing a Voice: 10 Steps for Marketing with Voice Assistants
Surefire Local
 
Sajit Joseph - The road to AI for the enterprise
Sajit Joseph - The road to AI for the enterpriseSajit Joseph - The road to AI for the enterprise
Sajit Joseph - The road to AI for the enterprise
Hilary Ip
 
Giving Marketing A Voice Shashi Bellamkonda Digital Summit 2017
Giving Marketing A Voice  Shashi Bellamkonda Digital Summit 2017Giving Marketing A Voice  Shashi Bellamkonda Digital Summit 2017
Giving Marketing A Voice Shashi Bellamkonda Digital Summit 2017
Shashi Bellamkonda
 
Shashi Bellamkonda - Giving Marketing a Voice - 10 Steps to Marketing Using V...
Shashi Bellamkonda - Giving Marketing a Voice - 10 Steps to Marketing Using V...Shashi Bellamkonda - Giving Marketing a Voice - 10 Steps to Marketing Using V...
Shashi Bellamkonda - Giving Marketing a Voice - 10 Steps to Marketing Using V...
Autumn Quarantotto
 
Google Analytics location data visualised with CARTO & BigQuery
Google Analytics location data visualised with CARTO & BigQueryGoogle Analytics location data visualised with CARTO & BigQuery
Google Analytics location data visualised with CARTO & BigQuery
CARTO
 
3 Business Problems Chatbots Solve Best
3 Business Problems Chatbots Solve Best3 Business Problems Chatbots Solve Best
3 Business Problems Chatbots Solve Best
Haptik
 
Natural born conversion killers - Conversion Jam
Natural born conversion killers - Conversion JamNatural born conversion killers - Conversion Jam
Natural born conversion killers - Conversion Jam
Craig Sullivan
 
Mobile presentation - Sydney Online Retailer - 26 Sep 2011
Mobile presentation - Sydney Online Retailer - 26 Sep 2011Mobile presentation - Sydney Online Retailer - 26 Sep 2011
Mobile presentation - Sydney Online Retailer - 26 Sep 2011
Craig Sullivan
 
Data & AI Master Class - Jan Klawer, Artefact
Data & AI Master Class - Jan Klawer, ArtefactData & AI Master Class - Jan Klawer, Artefact
Mobile product - "Build great apps!" at ProductTank Paris #17
Mobile product - "Build great apps!" at ProductTank Paris #17Mobile product - "Build great apps!" at ProductTank Paris #17
Mobile product - "Build great apps!" at ProductTank Paris #17
Alexandre Jubien
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
AkhilPolisetty
 
Breaking Language Barriers: Machine Translation for eCommerce
Breaking Language Barriers: Machine Translation for eCommerceBreaking Language Barriers: Machine Translation for eCommerce
Breaking Language Barriers: Machine Translation for eCommerce
kantanmt
 
Measure camp tools of the cro rabble
Measure camp   tools of the cro rabbleMeasure camp   tools of the cro rabble
Measure camp tools of the cro rabble
Craig Sullivan
 
Voice search optimization you should know | Strategies of voice engine optimi...
Voice search optimization you should know | Strategies of voice engine optimi...Voice search optimization you should know | Strategies of voice engine optimi...
Voice search optimization you should know | Strategies of voice engine optimi...
Cbitss Technologies
 
Slash n 2018 - Just In Time Personalization
Slash n  2018 - Just In Time Personalization Slash n  2018 - Just In Time Personalization
Slash n 2018 - Just In Time Personalization
FlipkartStories
 
Everwrite pitch deck
Everwrite pitch deckEverwrite pitch deck
Everwrite pitch deck
Diego Túlio Tomaz Gomes
 
SEO - What is it?
SEO - What is it?SEO - What is it?
SEO - What is it?
Woj Kwasi
 
The future of mobile marketing and the benefits of web apps @ Riga Comm 2013
The future of mobile marketing and the benefits of web apps @ Riga Comm 2013The future of mobile marketing and the benefits of web apps @ Riga Comm 2013
The future of mobile marketing and the benefits of web apps @ Riga Comm 2013
webapptool
 
Voice Technology Search Strategies
Voice Technology Search Strategies Voice Technology Search Strategies
Voice Technology Search Strategies
Melissa Walner
 

Similar to Integrating Voice Search in Magento 2 Using Web Speech API - Adrian Bece (20)

A Tale of Two Case Studies: Using LLMs in Production
A Tale of Two Case Studies: Using LLMs in ProductionA Tale of Two Case Studies: Using LLMs in Production
A Tale of Two Case Studies: Using LLMs in Production
 
Giving Marketing a Voice: 10 Steps for Marketing with Voice Assistants
Giving Marketing a Voice: 10 Steps for Marketing with Voice AssistantsGiving Marketing a Voice: 10 Steps for Marketing with Voice Assistants
Giving Marketing a Voice: 10 Steps for Marketing with Voice Assistants
 
Sajit Joseph - The road to AI for the enterprise
Sajit Joseph - The road to AI for the enterpriseSajit Joseph - The road to AI for the enterprise
Sajit Joseph - The road to AI for the enterprise
 
Giving Marketing A Voice Shashi Bellamkonda Digital Summit 2017
Giving Marketing A Voice  Shashi Bellamkonda Digital Summit 2017Giving Marketing A Voice  Shashi Bellamkonda Digital Summit 2017
Giving Marketing A Voice Shashi Bellamkonda Digital Summit 2017
 
Shashi Bellamkonda - Giving Marketing a Voice - 10 Steps to Marketing Using V...
Shashi Bellamkonda - Giving Marketing a Voice - 10 Steps to Marketing Using V...Shashi Bellamkonda - Giving Marketing a Voice - 10 Steps to Marketing Using V...
Shashi Bellamkonda - Giving Marketing a Voice - 10 Steps to Marketing Using V...
 
Google Analytics location data visualised with CARTO & BigQuery
Google Analytics location data visualised with CARTO & BigQueryGoogle Analytics location data visualised with CARTO & BigQuery
Google Analytics location data visualised with CARTO & BigQuery
 
3 Business Problems Chatbots Solve Best
3 Business Problems Chatbots Solve Best3 Business Problems Chatbots Solve Best
3 Business Problems Chatbots Solve Best
 
Natural born conversion killers - Conversion Jam
Natural born conversion killers - Conversion JamNatural born conversion killers - Conversion Jam
Natural born conversion killers - Conversion Jam
 
Mobile presentation - Sydney Online Retailer - 26 Sep 2011
Mobile presentation - Sydney Online Retailer - 26 Sep 2011Mobile presentation - Sydney Online Retailer - 26 Sep 2011
Mobile presentation - Sydney Online Retailer - 26 Sep 2011
 
Data & AI Master Class - Jan Klawer, Artefact
Data & AI Master Class - Jan Klawer, ArtefactData & AI Master Class - Jan Klawer, Artefact
Data & AI Master Class - Jan Klawer, Artefact
 
Mobile product - "Build great apps!" at ProductTank Paris #17
Mobile product - "Build great apps!" at ProductTank Paris #17Mobile product - "Build great apps!" at ProductTank Paris #17
Mobile product - "Build great apps!" at ProductTank Paris #17
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Breaking Language Barriers: Machine Translation for eCommerce
Breaking Language Barriers: Machine Translation for eCommerceBreaking Language Barriers: Machine Translation for eCommerce
Breaking Language Barriers: Machine Translation for eCommerce
 
Measure camp tools of the cro rabble
Measure camp   tools of the cro rabbleMeasure camp   tools of the cro rabble
Measure camp tools of the cro rabble
 
Voice search optimization you should know | Strategies of voice engine optimi...
Voice search optimization you should know | Strategies of voice engine optimi...Voice search optimization you should know | Strategies of voice engine optimi...
Voice search optimization you should know | Strategies of voice engine optimi...
 
Slash n 2018 - Just In Time Personalization
Slash n  2018 - Just In Time Personalization Slash n  2018 - Just In Time Personalization
Slash n 2018 - Just In Time Personalization
 
Everwrite pitch deck
Everwrite pitch deckEverwrite pitch deck
Everwrite pitch deck
 
SEO - What is it?
SEO - What is it?SEO - What is it?
SEO - What is it?
 
The future of mobile marketing and the benefits of web apps @ Riga Comm 2013
The future of mobile marketing and the benefits of web apps @ Riga Comm 2013The future of mobile marketing and the benefits of web apps @ Riga Comm 2013
The future of mobile marketing and the benefits of web apps @ Riga Comm 2013
 
Voice Technology Search Strategies
Voice Technology Search Strategies Voice Technology Search Strategies
Voice Technology Search Strategies
 

Recently uploaded

Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 

Recently uploaded (20)

Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 

Integrating Voice Search in Magento 2 Using Web Speech API - Adrian Bece

  • 1. #MM18PL#MM18PL Integrating voice search in Magento 2 using Web Speech API Adrian Bece | @AdrianBDesigns
  • 2. #MM18PL#MM18PL Adrian Bece ● Working at Inchoo since 2015 ● React Developer ● Certified Magento 1 Frontend Developer ● Worked on various Magento 1 and Magento 2 projects for international clients ● Worked on numerous personal React projects @AdrianBDesigns | codeadrian.github.io
  • 3. #MM18PL#MM18PL “Voice commerce represents the next major disruption in the retail industry (…) The speed with which consumers are adopting smart speakers will translate into a number of opportunities and even more challenges for traditional retailers and consumer products companies.” - John Franklin, OC&C (December 2017)
  • 4. #MM18PL#MM18PL Voice Shopping & Home assistants ● People are getting more accustomed to Voice Shopping (Smart Speaker / Home Assistants) ● Amazon dominates the Home assistant market with Echo device (68%) ● In late 2017, Walmart has teamed with Google to offer Voice Shopping ● Most commonly shopped categories through voice: Groceries (20%), Entertainment (19%), Electronics (17%), Clothing (8%) * ● Voice purchases tend to be stand-alone, lower value items * ● Prediction: Voice Shopping Market in US to grow from $2 billion to $40 billion in 2022 * * OC&C Strategy Consultants Study (December 2017)
  • 5. #MM18PL#MM18PL Voice Shopping & Home assistants - concerns ● Not convenient for obtaining information about product (attributes, description, price, etc.) ● Product keywords might change → voice search results might change ● 2% of the people who use Amazon’s Echo have made a purchase with their voices in 2018 * ● Of the people who used voice shopping, most people didn’t use Voice shopping again * ● People who did use Voice Shopping again, used it more extensively (searching, tracking orders, etc.) * ● Amazon tries to encourage Voice Shopping by offering discounts and better deals ● There is potential in Voice Shopping, but there is no established pattern which is familiar to users * Anonymous Sources (Amazon insider info) for “The Information” (August 2018)
  • 7. #MM18PL#MM18PL Browser Voice Search Potential ● Google Voice Search queries has grown 7x since 2010 ● Android - 1 of 5 searches are done by voice (US) ● Baidu - 1 of 10 searches are done by voice ● 1 of 3 users use voice recognition technology on their device daily ● Number of voice searches expected to continue growing ● Prediction: 50% of searches will be done by voice by 2020.
  • 8. #MM18PL#MM18PL Web Speech API ● Provides speech-input and text-to-speech functionality in a web browser ● Web apps are able to handle voice data ● Interesting new possibilities for accessibility and control mechanisms ● Features which are not typically available when using standard software ● Experimental technology ● Two main parts ● Speech Recognition API ● provides ability to recognize voice from an audio input ● Speech Synthesis API ● provides ability to read out the text content
  • 9. #MM18PL#MM18PL Speech Recognition API (63% global browser support)
  • 10. #MM18PL#MM18PL Speech Synthesis API (80% global browser support)
  • 11. #MM18PL#MM18PL Speech Recognition API ● It requires internet connection to work on Chrome ● HTTPS only - can be avoided if specific flag is set when running Chrome ● It requires a config flag to be set in Firefox ● Properties ● Grammar, Language, Single / Multiple Results, Final / Interim Results ● Events ● Audio start, Audio end, On error, On result, On speech start, On speech end, etc. ● Methods ● Starting speech recognition, Stopping with returning a result, Stopping without returning a result
  • 12. #MM18PL#MM18PL Speech Recognition Data • Settings • Interim Results • Single Result • Returns • Confidence • Transcript
  • 13. #MM18PL#MM18PL Voice recognition can be used for dictating text in a form field, as well as navigating to and activating links, buttons, and other controls. (…) Some voice recognition tools allow complete control over computer interaction, allowing users to scroll the screen, copy and paste text, activate menus, and perform other functions. - W3C Web Accessibility Initiative on “Voice Recognition”
  • 14. #MM18PL#MM18PL Accessibility ● Who benefits from the Speech Recognition functionality? ● People with physical disabilities who cannot use the keyboard or mouse. ● People with chronic conditions who need to limit or avoid using the keyboard or mouse. ● People with cognitive and learning disabilities who need to use voice rather than to type. ● People with temporary limitations, such as a broken arm. ● People who prefer to speak rather than type (Depends on the device type, situation, personal preference, etc.)
  • 15. #MM18PL#MM18PL web/js/ voiceSearch.js • General Structure • Options • Setup • Functions • Event Listeners • Support Functions define([ 'jquery', 'mage/translate', 'domReady!' ], function ($) { 'use strict'; $.fn.voiceSearch = function (options) { /*********** * OPTIONS * ***********/ /********* * SETUP * *********/ /************* * FUNCTIONS * *************/ }; return function (config, node) { $(node).voiceSearch(config); } });
  • 16. #MM18PL#MM18PL web/js/ voiceSearch.js • Options Section var defaults = { "placeholderText": "Listening...", "speechRecognitionTrigger": "#voice-search- trigger", "formInput": "#search" }, $formElement = $(this); options = $.extend(defaults, options); $formElement = $(this); var recognition = null; var isActive = false; var speechRecognitionTrigger = $(options.speechRecognitionTrigger), $formInput = $(options.formInput), placeholderText = $.mage.__(options.placeholderText); window.SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
  • 17. #MM18PL#MM18PL web/js/ voiceSearch.js • Setup Section if (window.SpeechRecognition) { recognition = new SpeechRecognition(); recognition.interimResults = true; this.setupRecognitionListeners(); this.setupVoiceSearchButton(); recognition.onresult = this.handleOnResult.bind(this); } else { speechRecognitionTrigger.hide(); }
  • 18. #MM18PL#MM18PL web/js/ voiceSearch.js • Functions Section • Event Listeners this.setupVoiceSearchButton = function () { speechRecognitionTrigger.on('click touch', this.startListening); }; this.setupRecognitionListeners = function () { recognition.onstart = function () { isActive = true; }; recognition.onend = function () { isActive = false; }; recognition.onerror = function () { isActive = false; }; };
  • 19. #MM18PL#MM18PL web/js/ voiceSearch.js • Functions Section • Support Functions this.parseTranscript = function (e) { return Array.from(e.results).map( function (result) { return result[0] }).map( function (result) { return result.transcript }).join(''); }; this.startListening = function (e) { e.preventDefault(); if(!isActive) { $formInput.val(''); $formInput.attr("placeholder", placeholderText); recognition.start(); } }; this.handleOnResult = function (e) { $formInput.val(this.parseTranscript(e).toLowerCase()); if (e.results[0].isFinal) { $formElement.submit(); } };
  • 20. #MM18PL#MM18PL requirejs-config.js • Standard mapping var config = { map: { '*': { 'voiceSearch': 'js/voiceSearch' } } };
  • 21. #MM18PL#MM18PL Magento_Search/templat es/form.mini.phtml • Add a call to the <form> element • Add voice search <button> • Add some id-s if necessary • Call the voiceSearch • Default parameters • Custom parameters (…) <form class="form minisearch" id="search_mini_form" action="<?= /* @escapeNotVerified */ $helper->getResultUrl() ?>" method="get" data-mage-init=‘{"voiceSearch":{}}'> (…) <button class="action search voice" id=“voice-search-trigger"></button> (…) (…)
  • 23. #MM18PL#MM18PL Result - Page Load • If Web Speech API is not supported, Voice search button will be hidden • User will be prompted to confirm microphone permission • After user grands permission, the text input placeholder will change to “Listening…”
  • 24. #MM18PL#MM18PL Result - Search Action • After user has finished speaking, text will be added to the search input form • Form submits and user is redirected to Magento 2 search results page • User can click again on the Voice Search button and perform search from the beginning
  • 25. #MM18PL#MM18PL Areas Of Improvement ● Confirm the input before submitting the form ● Cancel voice search if input is not received in some time limit ● Check if the confidence of the result is above certain percentage before submitting. If percentage is lower than the threshold, ask user to repeat the voice search. ● UX improvement - Better communication of current state (recording, submitting form, etc.) ● Open the product page for the first search result instead of search result page ● Use Google Cloud Speech-to-Text (paid) to enable language recognition and allow users to search in their native language.
  • 26. #MM18PL#MM18PL Additional Ideas ● Voice-controlled shopping ● Search, selecting products ● Selecting quantity, configuring, adding to cart ● Navigating to cart and checkout ● Voice-controlled On-screen assistant ● Speech Synthesis API ● Improved accessibility, voice-controlled shortcuts ● Voice-controlled shopping, contact forms, chat support, shortcuts, etc.
  • 27. #MM18PL#MM18PL There might be very few voice shoppers right now… but once you find out what’s special about them, you can grow them very quickly. That’s an unresolved problem. - The Information, “The Reality Behind Voice Shopping Hype” (August 2018)
  • 28. #MM18PL#MM18PL Conclusion ● People are still getting accustomed to Voice Shopping (home assistants and smart speakers) ● Voice search continues to grow across various desktop and mobile devices ● Web Speech API opens the door for speech recognition from a Web Browser (it’s still experimental) ● Beneficial for accessibility, also has potential for regular use ● Consider adding the functionality in stages and monitor how customers are using it ● Are they using it for product discovery or shop for familiar items? ● Are they using it more on mobile because it’s easier? ● Which voice-controlled functionalities are they using more and which they are using less?
  • 29. #MM18PL#MM18PL Thank you for your attention. Adrian Bece | @AdrianBDesigns