Setup Webchat Interface
Embedding Webchat
Learn how to embed the webchat interface in your website
Basic Implementation
Step 1: Add Script Tag
First, include the following script tag within the <head> section of your HTML document:
This script initializes the Stubber Webchat module.
Step 2: Add HTML Tag
Next, add the Webchat component to your webpage by including the following HTML tag where you want the chat window to appear:
Replace the profile_uuid with the UUID of your Webchat profile.
Note: To avoid overlay issues, place the Webchat tag within the
<body>tag.
Display Modes
Webchat offers several display modes to suit different website integration needs:
- Default Mode — floating button in the bottom right corner
- Embedded Mode — positioned within a custom div on your page
- Manual Mode — freely placed within your page layout
Advanced Configuration
Passing Custom Data
If you need to pass custom data from the Webchat to your stub, add the attribute pass_through_data to the stubber-webchat tag:
This data will be available in your stub at:
Using Stubref Instead of Profile UUID
If you've configured webchat via stub.data, you can use the stubref instead of a profile UUID:
Styling Your Webchat
You can customize the appearance of your webchat by setting the primary color CSS variable:
Note: Setting the primary color is completely optional. You can configure this color in your webchat profile settings instead of setting it inline. This approach is recommended for consistency across all instances of your webchat.
Complete Example
Here's a complete example of embedding webchat in a webpage: