Using Website Custom Buttons
Overview:
You’re installing Consolto but prefer to trigger the widget using buttons on your own website (rather than the widget icon provided by Consolto).
The widget can trigger one of the following six actions:
- Open widget ==> open-widget
- Start chat ==> start-chat
- Start video call ==> start-call
- Start audio call ==> start-audio-call
- Start scheduling ==> start-scheduling
- Start contact form ==> start-form
- Close widget==> close-widget
IMPORTANT NOTE: Before you continue, please note there are separate instructions for “Multi-agent” widget and “Single-agent”.
If you embed the script from the “Team Center’ in your website (available in our Enterprise plan), use the “Multi-agent widget” instructions.
Otherwise, use the “Single-agent widget” instructions.
Single-Agent Widget
Path 2: use the onclick event:
Example:
onclick="triggerConsoltoAction('open-widget')”
Explanation:
- To start an action programmatically, add the onclick handler to any HTML element - triggerConsoltoAction as per the example below:
onclick="triggerConsoltoAction('open-widget')”
- The action will not start unless the Consolto widget is ready. If you are sure the button will be clicked after Consolto has been fully loaded and ready, this is an easy way to trigger actions. Otherwise, you'll need to verify the Consolto widget is ready. This can be done programmatically. Refer to the "Trigger the widget programmatically" section
Multi-Agent Widget
Path 2: use the onclick event:
Example:
onclick="triggerConsoltoAction('open-widget', 'AgentIdHere-123123123')"
Explanation:
- To start an action programmatically, add the onclick handler to any HTML element - triggerConsoltoAction as below:
onclick="triggerConsoltoAction('open-widget', 'AgentIdHere-123123123')"
- The action will not start unless the Consolto widget is ready. If you are sure the button will be clicked after Consolto has been fully loaded and ready, this is an easy way to trigger actions. Otherwise, you'll need to verify the Consolto widget is ready. This can be done programmatically. Refer to the "Trigger the widget programmatically" section.
Q&A:
Q: How can I select an available agent programmatically?
A: in the et-agent-id field, put "AVAILABLE". We will select one of the available agents randomly.