Code Examples for Common Widget Integrations on Your Web Page
Custom Widget Initialization
On Button Click
<!DOCTYPE html>
<html>
<head></head>
<body>
<button id="widget-loader">Load Widget</button>
<script>
var widget_loaded = false;
document.getElementById("widget-loader", function(event) {
// Prevent double loading
if (!widget_loaded) {
widget_loaded = true;
// Load the widget
const project_token = "PROJECT_TOKEN";
const script_tag = document.createElement("script");
script.src = "https://platform.indigo.ai/widget.js?token=" + project_token + "&v=3";
document.body.appendChild(script);
}
})
</script>
</body>
</html>After a Specified Time Delay
On Scroll to a Specific Element
Interacting with the Widget
Opening the Widget After a Delay
Page Actions Triggered by Events
Actions Triggered by an Answer
Google Analytics
PreviousWeb Chat Integration: Dynamic Interaction and Data Exchange with Your WebsiteNextIntegrating Custom Channels with the Chat API
Last updated
Was this helpful?