FAQ
How To Display Widgets Using Code
You can trigger a Popup widget to display programmatically using JavaScript, giving you full control over when and how widgets appear.
Finding Your Widget ID
Open the widget in the editor. The widget ID is the number at the end of the URL in your browser's address bar.
Displaying a Widget with Code
Use the following JavaScript snippet to show a widget on page load:
<script type="text/javascript">
$(window).on('load', function(){
Popup.show(widget_id)
});
</script>
Replace widget_id with the actual numeric ID of your widget.
Custom Trigger Example
You can also trigger a widget on any event, such as a button click:
<script type="text/javascript">
document.getElementById('my-button').addEventListener('click', function(){
Popup.show(widget_id)
});
</script>
This approach is useful when you want to show a widget in response to a specific user action rather than relying on the built-in display rules.
Need more help?
If you've worked through this and still need a hand, contact support -- we'll dig in with you.