HTML container and parameters
To display Smart Assistant, it is necessary to insert a line of code with the HTML container of our web component called ‘smart-assistant’ that must include a mandatory unique ‘api-key’ variable to load the specific instance.
<!-- Web component Smart Assistant with variables in your template -->
<!-- Add this code inside the 'body' container of your page code -->
<smart-assistant
api-key="API-KEY"> <!-- provided by Usizy team -->
</smart-assistant>
In the case of single-page applications where HTML pages are not completely reloaded. Note that the web component parameters are configurable through javascript in real time.
For example, when changing the navigation to another page, we must indicate it to Smart Assistant as follows:
const assistant = document.querySelector('smart-assistant')
assistant.productId = newProductId
Likewise, if the user is logged in and can provide the data
const assistant = document.querySelector('smart-assistant')
assistant.userId = '12345'
Parameters
Below are the common parameters that can be used depending on the subscription mode and options enabled:
<!-- Web component Smart Assistant with parameters in your template -->
<!-- Add this code inside the 'body' container of your page code -->
<smart-assistant
api-key="API-KEY" (provided by Usizy team)
product-id="PRODUCT-ID" (associated to feed file)
language="LANGUAGE" (ISO 639-1: 'en', 'es', 'fr', 'de', ...)
user-id="USER_ID" (user identification)
email="USER_EMAIL" (user information)
first-name="USER_FIRST_NAME" (user information)
last-name="USER_LAST_NAME" (user information)
zip-code="USER_ZIPCODE" (user information)
>
</smart-assistant>
api-key
Smart Assistant instance unique identifier parameter for your eCommerce that enables the service for a specific instance. This API key will be provided by the Usizy team after successful prerequisite validation.
Mandatory: for all modules.
product-id
The unique product identifier parameter enables the identification of the product that the user is viewing on the page. This parameter is only required on product pages and must match the identifier provided in the product feed.
It allows the bot to answer questions about a specific product, add it to the basket, make size recommendations, etc.
Mandatory: for ‘Personal Shopper’ and ‘Size Adviser’ modules.
variation-id
The unique product variation identifier parameter enables the identification of the variation that the user is viewing on the page. This parameter is only required on product pages and must match the identifier provided in the product feed.
The variation typically distinguishes between the different colours of the product
It allows the bot to answer questions about the specific product variation, add it to the basket, etc.
Mandatory: for ‘Personal Shopper’
language
The Smart Assistant instance will be configured with a default language, although the eCommerce can manage the language displayed in the assistant through the language parameter.
Even if there is a language provided as a value, the user can review the wizard options and change the language among those available for the specific instance.
Recommended: To match the language in use, according to the main website configuration.
user-id
User identifier parameter in the eCommerce platform. Thanks to the user-id, in case of a returning user, our system can understand that it is dealing with the same person, and leverage previous conversation content, to generate a more natural conversation flow.
It can be used to retrieve the user’s data through an API provided by the eCommerce, and enhance the usability and personalization of the bot, avoiding the need for future data requests and lengthy conversations for certain actions requiring additional data.
Recommended: for better usability and personalization.
User’s email address parameter: enhances usability and personalization by avoiding the need for future data queries for specific actions. This parameter can be used in conjunction with the user-id parameter and the API to access user data for a more fluid conversation.
Recommended: for better usability and personalization.
first-name
First name of the identified user: enhances usability and personalization by avoiding the need for future data queries for specific actions. This parameter can be used by the bot to retrieve the user’s name directly.
Recommended: for better usability and personalization.
last-name
Last name of the identified user: enhances usability and personalization by avoiding the need for future data queries for specific actions. This parameter can be used by the bot to retrieve the user’s last name directly.
Recommended: for better usability and personalization.
zip-code
Zip code of the identified user: enhances usability and personalization by avoiding the need for future data queries for specific actions. This parameter can be used by the bot to retrieve the user’s postcode directly.
Recommended: for better usability and personalization.
city
City of the identified user: enhances usability and personalization by avoiding the need for future data queries for specific actions. This parameter can be used by the bot to retrieve the user’s city directly.
Recommended: for better usability and personalization.