Tips: Launch
Displays the Helply widget when a custom button on your website or app is clicked.
To allow custom buttons (e.g., "Contact Us" button) to trigger the Helply widget, follow these steps:
If you want to hide the default Helply trigger button, include the following embed script with the data-settings attribute set to {"hideTriggerButton": true}. This will hide the trigger button, and you can control when the widget is shown via your custom button.
If you don’t want to hide the button by default, you can skip this step.
Here is the updated embed script:
Replace YOUR_AGENT_ID with your actual Helply agent ID in the embed script.
Add a custom button (e.g., a "Contact Us" button) in your website’s HTML:
"contact-us-button">Contact Us
To trigger the Helply widget when the custom button is clicked, use the following JavaScript code. This script checks if the widget is available and opens it when the button is clicked:
document.getElementById('contact-us-button').addEventListener('click', function() {
if (window.helplyAgentWidget) {
window.helplyAgentWidget.open();
}
});
To close the Helply widget when another custom button is clicked, use the following JavaScript code. This script checks if the widget is available and closes it when the button is clicked:
document.getElementById('close-contact-us-button').addEventListener('click', function() {
if (window.helplyAgentWidget) {
window.helplyAgentWidget.close();
}
});