Widget Installation
Add the Chat24Plus live chat widget to your website in minutes. The widget provides a beautiful, customizable interface for customer conversations.
Quick Installation
Step 1: Get Your Widget ID
- Log in to your Chat24Plus Dashboard
- Navigate to Settings → Widget
- Copy your unique Widget ID (format:
c24p_xxxxxxxxxxxxx)
Step 2: Add the Code Snippet
Copy this code and paste it just before the closing </body> tag on every page where you want the chat widget to appear:
<script>
(function(w,d,s,o,f,js,fjs){
w['Chat24Plus']=o;w[o] = w[o] || function () {
(w[o].q = w[o].q || []).push(arguments)
};
js = d.createElement(s), fjs = d.getElementsByTagName(s)[0];
js.id = o; js.src = f; js.async = 1;
fjs.parentNode.insertBefore(js, fjs);
}(window, document, 'script', 'c24p', 'https://cdn.chat24plus.com/widget.js'));
c24p('init', {
widgetId: 'YOUR_WIDGET_ID'
});
</script>
Replace YOUR_WIDGET_ID with your actual Widget ID from the dashboard.
Step 3: Verify Installation
- Save your changes and upload to your web server
- Visit your website
- Look for the chat widget button (usually bottom-right corner)
- Click to open and send a test message
Send a test message and check your dashboard to confirm it appears in the Conversations section.
Platform-Specific Installation
WordPress
Option 1: Plugin (Recommended)
- Install the Chat24Plus plugin from WordPress Plugin Directory
- Activate the plugin
- Go to Settings → Chat24Plus
- Enter your Widget ID
- Click Save Changes
Option 2: Manual Installation
- Go to Appearance → Theme Editor
- Select footer.php from the right sidebar
- Paste the widget code before
</body> - Click Update File
Shopify
- Go to Online Store → Themes in your Shopify admin
- Click Actions → Edit Code
- Open
theme.liquidfrom the Layout folder - Paste the widget code before
</body> - Click Save
We also offer a native Shopify app for easier integration. Search for "Chat24Plus" in the Shopify App Store.
Wix
- Open your Wix Editor
- Click Settings → Custom Code
- Click + Add Custom Code
- Paste the widget code
- Set to load on All Pages
- Place code in Body - End
- Click Apply
Webflow
- Open your project in Webflow Designer
- Click Pages icon on the left
- Select the page (or use site-wide settings)
- Click Settings → Custom Code
- Paste the widget code in Footer Code
- Click Save and Publish
Squarespace
- Go to Settings → Advanced → Code Injection
- Paste the widget code in Footer section
- Click Save
Instructions work for both Squarespace versions. Code injection is available on Business plans and above.
Custom HTML / Static Sites
Simply paste the widget code before the closing </body> tag in your HTML files.
React / Vue / Angular
See our Framework Integration Guide for implementation in modern JavaScript frameworks.
Widget Configuration
Customize the widget appearance and behavior through the dashboard or JavaScript options.
Dashboard Configuration
Configure these options at Settings → Widget:
Appearance:
- Theme (Light/Dark/Auto)
- Primary color
- Button position (Right/Left)
- Button icon
- Welcome message
Behavior:
- Auto-open after delay
- Show on specific pages only
- Hide on mobile devices
- Require name/email before chat
Working Hours:
- Set business hours
- Custom offline message
- Collect email when offline
JavaScript Configuration
For advanced customization, pass options to the init function:
c24p('init', {
widgetId: 'YOUR_WIDGET_ID',
// Appearance
theme: 'light', // 'light', 'dark', 'auto'
primaryColor: '#0066FF',
position: 'right', // 'right', 'left'
// Behavior
autoOpen: false,
autoOpenDelay: 5000, // milliseconds
showOnMobile: true,
soundEnabled: true,
// Custom text
welcomeMessage: 'Hi! How can we help you today?',
inputPlaceholder: 'Type your message...',
// User information (pre-fill)
user: {
name: 'John Doe',
email: '[email protected]',
phone: '+1234567890',
customFields: {
company: 'Acme Corp',
plan: 'Business'
}
}
});
Advanced Features
Dynamic User Information
Pass user information from your system:
// After user logs in
c24p('identify', {
userId: '12345',
name: 'Jane Smith',
email: '[email protected]',
customFields: {
subscriptionPlan: 'Premium',
accountCreated: '2024-01-15'
}
});
Triggering Widget Programmatically
Control the widget via JavaScript:
// Open the widget
c24p('open');
// Close the widget
c24p('close');
// Toggle widget
c24p('toggle');
// Show widget button
c24p('show');
// Hide widget button
c24p('hide');
// Send a message programmatically
c24p('sendMessage', 'Hello, I need help with...');
Event Listeners
React to widget events:
// Widget opened
c24p('on', 'open', function() {
console.log('Chat widget opened');
// Your custom code
});
// Widget closed
c24p('on', 'close', function() {
console.log('Chat widget closed');
});
// New message received
c24p('on', 'message', function(message) {
console.log('New message:', message);
});
// Conversation started
c24p('on', 'conversationStarted', function(conversationId) {
console.log('Conversation ID:', conversationId);
});
Conditional Display
Show widget only on specific conditions:
// Show only for logged-in users
if (userIsLoggedIn) {
c24p('init', { widgetId: 'YOUR_WIDGET_ID' });
}
// Hide on specific pages
if (window.location.pathname === '/checkout') {
c24p('hide');
}
// Show after user scrolls
window.addEventListener('scroll', function() {
if (window.scrollY > 500) {
c24p('show');
}
});
Mobile Considerations
The widget is fully responsive and optimized for mobile devices:
- Automatic Fullscreen: Opens fullscreen on small screens
- Touch Optimized: Large touch targets for easy interaction
- Performance: Lightweight and fast loading
- Native Feel: Smooth animations and transitions
Mobile-Specific Options
c24p('init', {
widgetId: 'YOUR_WIDGET_ID',
mobile: {
fullscreen: true, // Always open fullscreen on mobile
minimized: false, // Start minimized on mobile
hideButton: false // Hide widget button on mobile
}
});
Performance Optimization
The widget is designed for optimal performance:
- Async Loading: Non-blocking script load
- Lazy Initialization: Loads resources on first interaction
- CDN Delivery: Fast global content delivery
- Small Footprint: ~45KB gzipped
- No Dependencies: No jQuery or other libraries required
Best Practices
✅ Do:
- Place code at end of
<body>for better page load performance - Use async attribute (included by default)
- Test on various devices and browsers
- Monitor console for any errors
❌ Don't:
- Load multiple instances on same page
- Modify widget code directly
- Block script loading with ad blockers during testing
Customization Examples
Example 1: E-commerce Store
c24p('init', {
widgetId: 'YOUR_WIDGET_ID',
welcomeMessage: 'Welcome! Need help finding the perfect product?',
primaryColor: '#FF6B6B',
autoOpen: true,
autoOpenDelay: 10000, // Open after 10 seconds
user: {
customFields: {
cartValue: '$125.00',
itemsInCart: 3
}
}
});
Example 2: SaaS Application
c24p('init', {
widgetId: 'YOUR_WIDGET_ID',
theme: 'dark',
primaryColor: '#7C3AED',
position: 'right',
user: {
userId: currentUser.id,
name: currentUser.name,
email: currentUser.email,
customFields: {
plan: currentUser.subscription,
daysActive: currentUser.daysActive
}
}
});
Example 3: Support Portal
c24p('init', {
widgetId: 'YOUR_WIDGET_ID',
welcomeMessage: 'Hi! Having trouble? We\'re here to help!',
autoOpen: false, // Don't auto-open
soundEnabled: true,
showOnMobile: true
});
// Auto-open if URL contains error parameter
if (window.location.search.includes('error=')) {
c24p('open');
}
Troubleshooting
Widget Not Appearing
- Check Widget ID: Ensure it's correct and properly formatted
- Browser Console: Open DevTools and check for JavaScript errors
- Script Location: Verify code is before
</body>tag - Ad Blockers: Temporarily disable ad blockers
- HTTPS: Ensure your site uses HTTPS
Widget Appears But Doesn't Work
- Network Tab: Check if
widget.jsloads successfully - CORS Issues: Verify your domain is whitelisted in dashboard
- Content Security Policy: Add Chat24Plus domains to CSP if applicable
- Browser Compatibility: Test in different browsers
Multiple Widgets Appearing
- Ensure you haven't added the code multiple times
- Check if theme/plugins are injecting duplicate code
- Use browser DevTools to identify duplicate scripts
Widget Styling Issues
- CSS Conflicts: Check for conflicting styles in your stylesheet
- Z-index Issues: Widget uses z-index: 999999
- Position Conflicts: Ensure no fixed elements overlap
- Custom CSS: Contact support for custom styling needs
Security Considerations
- Widget uses HTTPS encryption for all communications
- User data is transmitted securely
- Widget validates origin domain
- XSS protection built-in
- Regular security audits performed
Next Steps
- Connect Integrations - Add WhatsApp, Telegram, etc.
- Configure Live Chat - Set up human agent features
- Customize Appearance - Advanced styling options
Need help with installation? Contact our support team or check the FAQ.