Integrating a chatbot with your website can greatly enhance the customer experience and help you engage with your customers more effectively. With the feature to start a specific topic in the PBrain chatbot, you can guide your customers to the information they need quickly and efficiently, without them having to navigate through multiple pages or wait for a response from a support personnel.
To start a specific topic in your chatbot when your customers click a button on your website, you can use the code snippet below.
<script>
document.addEventListener("DOMContentLoaded", () => {
document.getElementById("launch").addEventListener("click", () => {
PBrain.config({
chatLogic: "Better serve your customers",
});
});
});
</script>
<button id="launch" type="button">Start</button>
Here is how it works: the DOMContentLoaded
event ensures that the code runs only after the webpage has been loaded. The getElementById
retrieves the button to add a click
event listener. Finally, the event listener starts a specific topic in the chatbot.
If you would like a one liner, here’s how
<button
type="button"
onlick="PBrain.config({ chatLogic: 'Better serve your customers' })"
>
Start
</button>
We hope you leverage this feature to streamline your customer interactions and enhance customer engagement!