Web
Webflow
Embedding Your agent in Webflow
To embed your agent in Webflow, follow these steps:
- Go to the Integrations tab of your agent’s flow editor.
- Click the Webflow button to get the embed instructions.
Advanced Guides
Trigger an agent Command on Button Click
You can trigger an agent command (like opening a popup) when a button is clicked. Here’s how:
-
Assign a unique ID to your button:
- Navigate to the Settings tab of the button in Webflow.
- Add a dedicated ID to the button element.
-
Update your embed code:
- In the existing
<script>
tag of your agent Embed element, insert the following code:
- In the existing
-
For multiple buttons, repeat the process:
- Add more button IDs and associate them with the same or different commands. Your code might look like this:
Note: Replace
BUTTON_ID_1
andBUTTON_ID_2
with the actual IDs assigned to your buttons.
Example Use Case
In this example, clicking the specified buttons will open the agent popup. However, you can replace Agent.open()
with any other command supported by the Java library commands.
Validation and Testing
Before deploying, ensure:
- All button IDs match those specified in the script.
- The JavaScript code does not contain syntax errors.
- The agent popup works as expected when the buttons are clicked.