When loading the Laiye Chatbot widget on your website, you can modify its behavior by setting some attributes for the component.
They can be set in the following way:
widget.setAttribute("attribute", "value");Here is a full example of integrating a widget and setting an attribute:
<script>
var widget = document.createElement("destygo-webchat");
widget.setAttribute('id', "destygo_widget");
widget.setAttribute('class', "destygo_widget");
widget.setAttribute('token', "d8380225-f558-f1d8-d055-f022657c95c4");
widget.setAttribute("attribute", "value");
document.body.appendChild(widget);
</script>
<script type="text/javascript" src="https://widget.mindsay.com/destygo-webchat.js"></script>Here are the attributes that you can currently modify:
Attribute | Values | Description |
|---|---|---|
mobile |
| Set to |
useLocalStorage |
| Set to |
disableCsatDisplayedZdTag |
| Set to |
user_consent |
| Set to |
Passing attributes to bot context
Custom attributes added this way are also passed to the Bot context, so that you can enrich your use-cases based on data coming from your website.
Check that tutorial for more information about this.