Quick Start
Getting Your Tracking Code
- Log in to your G-Tateth dashboard
- Navigate to Settings > Product > Chat Widget
- Go to the Integration tab
- Copy the tracking code displayed in the “Tracking Code” field
Basic Implementation
Add the tracking code to your website’s<head> section. The tracking code will look like this:
- Replace
your-domain.comwith your actual account domain (found in your dashboard settings) - Replace
https://api.g-tateth.comwith your backend API URL (found in your dashboard settings) - The script URL (
https://g-tateth.com/widget/script.iife.js) may vary based on your environment - The
data-accountattribute is required and tells the widget which account configuration to load (uses your domain for security) - The
data-base-urlattribute specifies the backend API URL (defaults tohttps://api.g-tateth.comfor production) - Place the script in the
<head>section for best performance - Security: The tracking code uses your domain instead of internal IDs for better security
React/Next.js Implementation
For React applications, you can use the widget script directly or use the programmatic API: Option 1: Using the Script Tag (Recommended) Add the tracking code to your_document.tsx or _app.tsx:
Configuration Options
Widget Configuration
Your unique tenant identifier. Get this from your dashboard settings page. You can also use
tenantDomain instead if you prefer.Your tenant domain (alternative to tenantId). Use this if you prefer to identify by domain instead of ID.
API base URL. Required when using the tracking code script tag. Default:
https://api.g-tateth.com (or auto-detected as fallback when using programmatic mount)Your company name displayed in the widget header.
URL to your company logo. Supports SVG, PNG, or JPG.
Initial message shown when widget opens. Default: “Welcome! How can we help you?”
Primary brand color (hex code). Default:
#2f4a6bWidget position:
bottom-right, bottom-left, top-right, or top-left. Default: bottom-rightBusiness hours configuration:
Feature flags:
API Integration
All widget API endpoints are documented in the API Reference tab. This section provides integration examples and workflows.
Public Widget Settings Endpoint
The widget automatically fetches its configuration from the public settings endpoint: Endpoint:GET /api/widget/settings
Query Parameters:
tenantId(required if tenantDomain not provided) - Your tenant IDtenantDomain(required if tenantId not provided) - Your tenant domain
Initialize Widget Session
Use the Initialize Widget Session endpoint to create a new widget session. Required Parameters:tenantIdortenantDomain- Your tenant identifier
customerInfo- Customer information object:
sessionId- Unique session identifierconversationId- Conversation ID if continuing existing conversationconfig- Widget configuration including business hours, features, etc.
Send Message
Send messages from the widget using the Send Message endpoint. Required Parameters:conversationId- Conversation IDtenantId- Tenant IDtext- Message text content
attachments- Array of file attachments
Get Messages
Retrieve conversation messages using the Get Messages endpoint. Query Parameters:limit- Number of messages to return (default: 50)before- Message ID to fetch messages before (for pagination)
Get Online Agents
Get list of online agents using the Get Online Agents endpoint. Query Parameters:tenantId- Tenant ID (required)
Advanced Features
Custom Styling
Customize the widget appearance with CSS:Event Handlers
Listen to widget events:File Attachments
Enable file uploads in the widget:AI-Powered Responses
The widget includes built-in AI that can:- Answer common questions automatically
- Escalate to human agents when needed
- Learn from your knowledge base
- Provide 24/7 support
Agent Handoff
When AI can’t help, conversations automatically escalate to human agents:WebSocket Integration
For real-time updates, connect to the WebSocket:Best Practices
Performance
- Load the widget script asynchronously
- Use lazy loading for non-critical features
- Minimize custom CSS overrides
- Cache widget configuration
Security
- Always use HTTPS in production
- Validate customer data before sending
- Implement rate limiting on your side
- Use secure WebSocket connections (WSS)
User Experience
- Show clear offline/online status
- Provide helpful welcome messages
- Enable file attachments for better support
- Use business hours to set expectations
Analytics
Track widget usage:Troubleshooting
Widget Not Loading
- Check browser console for errors
- Verify
tenantIdis correct - Ensure API URL is accessible
- Check CORS settings
Messages Not Sending
- Verify WebSocket connection
- Check network tab for failed requests
- Ensure authentication is working
- Check rate limits
Styling Issues
- Check for CSS conflicts
- Verify custom CSS is loading
- Use browser dev tools to inspect
- Clear browser cache
Examples
E-commerce Integration
SaaS Application
Support
Need help? Contact us:- Email: support@g-tateth.com
- Documentation: https://docs.g-tateth.com
- Dashboard: https://app.g-tateth.com