Skip to main content

Smart Bot Snippet

Integration

The installation of the Smart Bot solution on the customer's site is done by integrating a snippet of javascript code within the desired page.

JS

Integrate the Javascript snippet just before closing the </body> tag. The Smart Tribune script must be loaded as far downstream as possible in the script loading chain in order to avoid possible conflicts with the scripts present on the client page.

<script type="text/javascript">
window.addEventListener('STBOTLoaded', function (e) {
e.detail.init({
kbId: 0,
locale: 'en',
relativeRestPath: 'xxx',
});
});
</script>
<script
type="text/javascript"
async
src="https://assets.app.smart-tribune.com/smart-tribune/BOT/bot.main.js"
></script>

The integration of the code snippet above is sufficient to allow the partial display of the BOT within the page. You must also communicate your domain name to your Smart Tribune contact point so that we allow the product to be displayed completely on your environment.

Please note, the link to bot.main.js is a demonstration of the product, the smart-tribune folder in the url will be replaced by the one that will be communicated to you. The url changes completely during the transition from pre-production (public) to production. The complete url is communicated by your Smart Tribune contact point in charge of your account.

info

The domains calling on the specified knowledge base must be declared beforehand directly in the knowledge base configuration in Smart Dashboard by your Account Manager.

Validation environment

caution

This url differs depending on the environment on which the solution is to be installed at the customer site. It is customary to use PUBLIC for pre-production and to use PRODUCTION for production at the customer site. All this information is communicated by Smart Tribune after the development phase.

PRODUCTION script

<script
type="text/javascript"
async
src="https://assets.app.smart-tribune.com/smart-tribune/BOT/bot.main.js"
></script>

PRE-PRODUCTION script

<script
type="text/javascript"
async
src="https://assets.app.smart-tribune.com/smart-tribune/BOT/public/bot.main.js"
></script>

Variables list

VariableTypeConditionExampleDescription
kbIdintrequiredkbId : 0Variable specific to each customer, it corresponds to the identifier (system identifier) of the knowledge base to be used. This is available in Smart Dashboard, the content administration interface. You can find your kbId on the Dashboard home page in the "Select a knowledge base" then "system identifier" box.
localestringrequiredlocale : "en"It allows the customer to specify in which language the solution should be displayed. This only applies to multilingual knowledge bases.
relativeRestPathstringrequiredrelativeRestPath: "path/xx/..."This configuration variable allows you to specify the path to connect the bot. It will be given by the Account Manager in charge of your project.