Chat Widgets
Overview
Chat widgets are embeddable chat interfaces that you can add to your website. When visitors use the chat widget, their messages come directly into brayv.ai Conversations and are handled by your default global AI agent. Chat widgets collect their phone number and a message, and then lets the contact know they will receive a text message. Your Global default text ai agent (if configured: Settings > Text AI) responds to their message via SMS.
Chat widgets are perfect for:
- Website visitor engagement
- Real-time lead capture
- Initiating conversations that continue via SMS
- Providing instant responses on your website
- Qualifying leads before they leave your site
Important: Chat widgets don't have journey enrollment configuration. Conversations start with your default global AI agent, which can add contacts to journeys using conditional tools when appropriate, and can also just answer general customer service questions based on the instructions you give it and info in your knowledge base.
Creating a Chat Widget
Step 1: Go to Settings > Lead Sources
Step 2: Click "Create New" and select "Chat Widget"
Step 3: Configure widget settings (detailed below)
Step 4: Click "Create Chat Widget"
Step 5: Copy the embed code and add to your website
Chat Widget Configuration
Basic Settings
Name (Required)
- Internal name for the widget
- Not visible to website visitors
- Example: "Main Website Chat", "Landing Page Widget"
Text Customization
Bubble Text
- Text shown on the floating chat button/bubble
- Default: "Text us here!"
- Customize: "Chat with us!", "Need help?", "Get a quote!"
- Keep it short (2-4 words works best)
Header Text
- Text shown at the top of the opened chat window
- Default: "Send us a message"
- Customize: "How can we help?", "Let's chat", "Get in touch"
Instructions
- Helpful text shown in the chat window
- Default: "Enter your info here and a quick message, and we'll text you back right away!"
- Customize to set expectations
- Example: "Share your name, phone number, and question - we'll text you right back!"
Placeholder Text
- Placeholder in the message input field
- Default: "Type your message here..."
- Customize: "What can we help with?", "Your question..."
Submit Button Text
- Text on the send button
- Default: "Send Message"
- Customize: "Send", "Chat Now", "Let's Talk"
Success Message
- Message shown after successful submission
- Default: "Thanks for your message! We'll get back to you soon."
- Customize: "Got it! We'll text you shortly.", "Thanks! Check your phone for our message."
Required Information Collection
The chat widget automatically collects:
- First Name - Required
- Phone Number - Required for AI to continue conversation via SMS
- Initial Message - What the visitor wants to talk about
Note: These fields are not configurable - they're essential for the widget to function properly.
Opt-In Settings
Enable Opt-In
- Toggle to show/hide SMS opt-in checkbox
- Highly Recommended - Should always be enabled for compliance
Opt-In Required
- Make the opt-in checkbox required before submission
- Highly Recommended - Ensures SMS compliance
Opt-In Text
- Customizable compliance text
- Default provided automatically from your account settings
- Good opt-in example text: "By submitting my phone number I agree to receive calls and or text messages from (insert your business name). Carrier message and data rates may apply. Calls may include AI or machine generated voices. Message frequency varies."
Why Opt-Ins Matter:
- Required for SMS compliance regulations
- Protects your business
- Sets proper expectations with visitors
- Always use opt-ins for chat widgets that are external, i.e. on your public website
Bot Protection (Cloudflare Turnstile)
Enable Turnstile
- Toggle to enable Cloudflare Turnstile bot protection
- Adds invisible or minimal challenge to prevent spam
- Free protection from bots and automated spam
When to Use:
- Public-facing websites
- High-traffic sites
- If experiencing spam chat submissions
When to Skip:
- Internal sites
- Sites with very low traffic
- Behind authentication
Setup: Enabling Turnstile requires Cloudflare configuration in your account settings. Contact support if you need help.
Styling
Primary Color
- Main color for widget elements (header, send button)
- Defaults to your account's brand color
- Enter hex color code (e.g., #3B82F6)
Secondary Color
- Accent color for secondary elements
- Defaults to complement primary color
- Enter hex color code (e.g., #10B981)
Widget Logo URL (Optional)
- Custom logo shown in widget header
- Provide full URL to logo image
- If not provided, uses your account logo
- Recommended size: 40x40 to 200x200 pixels
- Example:
https://yourdomain.com/logo.png
Active/Inactive Toggle
Active
- Widget is live and accepts messages
- Visitors can start conversations
Inactive
- Widget is disabled
- Useful for temporarily disabling without removing embed code
- Visitors won't see the widget on your site
Embedding Your Chat Widget
After creating the widget, embed it on your website.
Getting the Embed Code
Step 1: Open your chat widget in Lead Sources
Step 2: Go to the "Embed" tab
Step 3: Copy the embed code provided
Example Embed Code Format (do not copy this):
<script>
(function() {
var script = document.createElement('script');
script.src = 'https://cdn.brayv.ai/chat-widget.js';
script.setAttribute('data-widget-id', '[WIDGET_ID]');
script.async = true;
document.body.appendChild(script);
})();
</script>
Installing on Your Website
Where to Place:
Add the embed code before the closing </body> tag of your website.
For Most Websites:
- Access your website's HTML
- Find the
</body>tag (usually in footer or layout template) - Paste embed code just before
</body> - Save and publish
Platform-Specific Instructions:
WordPress:
- Go to Appearance > Theme Editor (or use plugin like "Insert Headers and Footers")
- Add code to footer.php before
</body> - Or use a plugin like "Custom HTML" widget in footer
Squarespace:
- Go to Settings > Advanced > Code Injection
- Paste code in "Footer" section
- Save
Wix:
- Go to Settings > Custom Code
- Add new code
- Paste embed code
- Set to load on "All Pages" and "Body - end"
- Apply
Shopify:
- Online Store > Themes > Actions > Edit Code
- Open
theme.liquid - Paste before
</body>tag - Save
Webflow:
- Project Settings > Custom Code
- Paste in "Footer Code" section
- Publish site
Custom/HTML Websites:
- Open your HTML file
- Find
</body>tag - Paste embed code before it
- Upload file to server
Widget Appearance
Default Position:
- Bottom right corner of screen
- Floating above content
- Collapses to small bubble
- Expands when clicked
Mobile Responsive:
- Automatically adapts to mobile screens
- Full-screen when opened on small devices
- Touch-optimized
How Chat Widgets Work
User Flow
- Visitor sees chat bubble on your website
- Clicks bubble to open chat window
- Sees instructions and form fields
- Enters name, phone, and message
- Checks opt-in box (if required)
- Clicks send
- Sees success message
- Receives text message response from AI agent (if default global agent configured in Settings > Text AI)
System Flow
- User submits chat widget
- Contact created or updated (matched by phone)
- Message appears in Conversations (like an incoming SMS)
- Default global AI agent receives the message (if default global agent configured in Settings > Text AI)
- AI agent responds via SMS to the phone number provided
- Conversation continues via text messaging
- AI can add contact to journey using conditional tools if appropriate, or send you notifications based on certain things the contact is interested in etc. (configure by adding a conditional tool with an action)
Contact Matching
If phone number matches existing contact:
- Contact is updated
- Message added to conversation history
If phone number doesn't match:
- New contact is created
- All fields saved
- New conversation started
Note: Matching is by phone number only.
Integration with AI Agents
Chat widgets do NOT have direct journey assignment.
Instead:
- Messages go to your default global AI agent (Settings > Text AI)
- Global agent responds and engages
- Global agent can use conditional tools to add to journeys
- Once added to journey, journey AI agent takes over
Example Flow:
Visitor submits chat widget: "I need HVAC repair"
↓
Default global AI agent receives message
↓
AI responds: "Hi! I'd be happy to help. Can you tell me more about the issue?"
↓
User responds with details
↓
AI conditional tool triggers: "user indicates HVAC need"
↓
Contact added to HVAC Journey
↓
HVAC Journey AI agent takes over conversation
Chat Widget vs Forms vs Webhooks
When to Use Chat Widgets
Best For:
- Conversational lead capture
- Instant engagement
- Continuing conversation via SMS
- Building rapport before phone number collection
- Easy acccess customer support for your customers
Advantages:
- Low friction
- Higher engagement rates
- Immediate AI response
- Continues seamlessly to SMS
- Not tied to any specific request type
When to Use Forms Instead
Better For:
- Specific information collection
- Complex data requirements
- Direct journey enrollment
- Landing pages with specific goals
When to Use Webhooks Instead
Better For:
- Third-party integrations
- Automated lead sources
- External systems
- Custom workflows
Best Practices
Configure Your Default Global Agent
Since chat widgets use your default global agent:
- Ensure global agent is configured (Settings > Text AI)
- Add conditional tools for actions you want taken on common requests
- Include "Add to Journey" tools for different scenarios
- Test the agent thoroughly
- Ensure you add relevant FAQs to AI knowledge base
Example Global Agent Tools:
- "User mentions HVAC" → Add to HVAC Journey
- "User mentions plumbing" → Add to Plumbing Journey
- "User mentions emergency" → Send Jake Smith email notification
Always Enable Opt-Ins
For SMS Compliance:
- Enable SMS opt-in
- Make it required
- Use default compliant text
- This protects your business
Set Clear Expectations
In Instructions Text:
- Tell visitors they'll receive a text message
- Set response time expectations
- Example: "We'll text you back within 2 minutes!" (only do this if you are allowing the AI to respond to these messages)
Keep Bubble Text Short
Best Bubble Text:
- "Chat with us!"
- "Text us here"
- "Need help?"
- "Get a quote"
Avoid:
- Long sentences
- Multiple lines
- Detailed instructions (save for the opened window)
Match Your Brand Colors
- Set primary color to your brand color
- Ensures widget looks native to your site
- Better conversion rates
Test Before Going Live
Testing Checklist:
- Submit a test chat from your website
- Verify message appears in Conversations
- Confirm AI agent responds
- Check contact was created correctly
- Test on mobile devices
- Verify styling looks good on your site
Monitor Chat Widget Performance
Track:
- Number of chat submissions
- Conversion to booked appointments
- Response times
- Common questions/requests
Optimize Based On:
- Which messages the AI handles well
- What causes confusion (add FAQs to knowledge base or additional instructions for agent)
- Common journey add triggers
Use Custom Logo for Multiple Sites
If you have multiple websites or brands:
- Create separate widgets
- Use different logos for each
- Customize colors to match each site
- Track performance separately
Troubleshooting
Problem: Widget not appearing on website
Solution:
- Verify embed code is correctly placed before
</body>tag - Clear browser cache and hard refresh (Cmd+Shift+R or Ctrl+Shift+F5)
- Check widget is set to "Active" in brayv.ai
- Verify embed code wasn't modified
- Check browser console for JavaScript errors
- Ensure your website allows external scripts
Problem: Messages not appearing in Conversations
Solution:
- Verify widget is active
- Check that user submitted with valid phone number
- Review Chat Widget history for errors
- Verify default global AI agent is configured
- Check account has text messaging enabled
Problem: AI not responding to chat messages
Solution:
- Verify default global AI agent is set (Settings > Text AI)
- Verify new contacts default to AI enabled (Settings > Text AI)
- Check that AI agent has instructions configured
- Ensure account has active phone number and A2P approved
- Verify contact has text AI enabled
- Check AI Text Agent Logs for errors
Problem: Opt-in checkbox not showing
Solution:
- Verify "Enable Opt-In" is toggled on
- Save widget settings again
- Clear cache and test again
- Check that opt-in text is configured
Problem: Widget styling looks wrong
Solution:
- Adjust primary and secondary colors
- Check that logo URL is valid and accessible
- Test on different browsers
- Verify colors are in hex format (#RRGGBB)
- Try clearing custom logo to use default
Problem: Getting spam submissions
Solution:
- Enable Cloudflare Turnstile bot protection
- Make opt-in required (adds friction)
- Monitor submission patterns
- Turn off AI and enable Do Not Text for repeat offender phone numbers
Problem: Widget conflicts with site design
Solution:
- Adjust colors to match site better
- Ensure widget doesn't cover important site elements
- Test on mobile and desktop
Problem: Contact created without phone number
Solution:
- Phone is required field - should not be possible
- Verify widget configuration
- Check widget version (may need update)
- Contact support if issue persists
Advanced Tips
Multiple Widgets for Different Pages
Create separate widgets for:
- Different products/services
- Different traffic sources
- A/B testing different messaging
Benefits:
- Track performance by page
- Customize messaging per audience
- Better analytics
Coordinate with Global Agent
Design your global agent with chat widgets in mind:
In Agent Configuration and Knowledge:
- Include knowledge for website-specific questions (ie, "what page can i find your photos of previous projects on?" Add an FAQ to knowledgebase with a link to your gallery page)
- Have tools and instructions ready for common chat widget requests (ie, Conditional Tool: trigger condition: "the user indicates they need service on their water treatment system". Action: send email notification to Joe Smith. In the Agent instructions, goals section: "if the user indicates they need service on their water treatment system, tell them you will notify the team and someone will contact them shortly.")
Track Lead Source
All chat widget contacts have:
- Source automatically set
- Can filter by chat widget source
- Track conversion rates
- Compare to other lead sources in dashboard (opportunities only created when added to a journey)
Related Features
- AI Text Agents - Configure the global agent that handles chat
- Managing Contacts - View contacts from chat widget
- Forms - Alternative lead capture method