Appzi Docs

Triggering the widget via JS

Triggering the widget via JS

You can choose to open the button via JS, a few common cases would be custom buttons or triggering the widget based on user interactions.

Triggering the widget via appzi.openWidget

Appzi creates a global variable named appzi. You can use the openWidget method to show a widget.

<button
onclick="appzi && appzi.openWidget('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')"
>
Leave Feedback
</button>

where xxxxxx.... is the id of the widget you want to open.

Triggering the widget via data-az-l attribute

You can use the attribute data-az-l=widgetId to mark any element as a trigger for the widget.

<a data-az-l="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">Leave Feedback</a>