Web Widget
This feature enables you to seamlessly integrate your Copilot into your existing website, providing easy access for visitors.
General
-
Audio Transcription - Enables converting voice inputs into text directly within the widget.
-
AI Web Call - Allows users to make calls directly from the web widget.
cautionActivating this feature will consume platform credits with each call. Ensure that your account has sufficient credits to continue using this feature without interruptions
-
You can also adjust the Copilot Position on the Website.
-
Draggable - When enabled, users on your website can drag and position the Copilot widget anywhere on the screen.
-
Mobile Device Visibility - When enabled, users on mobile devices will be able to view and interact with the widget seamlessly.
-
Logged In Users Only - When the “Logged In Users Only” toggle is enabled, the widget will only be visible to users who have signed in. This ensures that only authenticated users can access the widget.
a. Set User Context
To activate this feature, you need to use the
setUser
event to provide the necessary user details to the widget for authentication. If the details are not passed, the user will not be able to interact with the Copilot chatbot.window?.copilot?.("event", "setUser", {
hostId: "12312", // Mandatory
email: "[email protected]",
name: "Smith",
additionalFields: {
orgId: 123,
},
});
Either the Email or Name field (or both) must be provided in addition to the Id. This ensures sufficient information for user identification and interaction.
Field | DataType | Description | |
---|---|---|---|
hostId | String | The hostId is a unique identifier assigned to each user, and it is mandatory to include this field. | |
String | The user’s email address. It’s not necessary, but it’s helpful for extra identification and communication. | ||
name | String | The user’s full name, used to personalize interactions. | |
phone | Integer | The user’s phone number. It’s not mandatory but can be useful for contact purposes. | |
profilePicUrl | String | A URL to the user’s profile picture. It’s not mandatory but can enhance user profiles with a visual element. | |
Additional details | Object | Additional details like age, gender, and interests can improve your Copilot chatbot’s responses. You can also add other relevant information to better tailor interactions if needed. |
b. Unset User
- When a user logs out, you’ll need to pass the necessary details using the
unsetUser
event to clear their session from the widget. - Use the following event to log out a user:
window?.copilot?.("event", "unsetUser");
-
Resume Conversation On Open
When enabled, the Copilot resumes the last conversation with the user. If disabled, it starts a new conversation each time the page is opened. This feature ensures continuity for returning users or creates a fresh experience depending on your preferences.
Embed Code
To add the Copilot to your website, copy and paste the following code into your webpage: