Apologies, but no results were found. Perhaps searching will help find a related post.
/* ChatGPT Web Bot Integration for WordPress */
(function() {
// Load OpenAI API
var chatbotContainer = document.createElement('div');
chatbotContainer.id = 'chatbot-container';
document.body.appendChild(chatbotContainer);
var chatbotScript = document.createElement('script');
chatbotScript.src = 'https://cdn.jsdelivr.net/npm/openai-chatbot'; // Replace with actual ChatGPT API script
chatbotScript.async = true;
chatbotScript.onload = function() {
console.log('ChatGPT Web Bot loaded successfully');
initChatbot();
};
document.head.appendChild(chatbotScript);
function initChatbot() {
if (typeof ChatGPTBot !== 'undefined') {
ChatGPTBot.init({
botId: 'YOUR_CHATGPT_BOT_ID', // Replace with your OpenAI bot API key
welcomeMessage: 'Hello, please enter your name and email so I can assist you better.',
themeColor: '#0073e6',
position: 'bottom-right',
autoOpen: false,
steps: {
step1: {
message: 'What can I help you with today?',
options: ['SALES', 'MARKETING', 'SUPPORT', 'SOMETHING ELSE']
},
sales: {
message: 'Hello, my name is Kal. Would you like to book a call with our sales engineer?',
options: ['Yes', 'No'],
yesAction: 'link_to_calendly',
nextMessage: 'Would you like me to send you our Sales PDF?',
pdfAction: 'send_sales_pdf'
},
marketing: {
message: 'Hello, I am Clare from Marketing. Would you like to book a call?',
options: ['Yes', 'No'],
yesAction: 'link_to_calendly',
nextOptions: ['Tell me about your new product', 'Benefits of your product', 'Recommend a product', 'Something else'],
faqLookup: true
},
support: {
message: 'Please use our online support ticketing system or describe your issue.',
captureInput: true,
faqLookup: true
}
},
onLeadCapture: function(lead) {
console.log('Lead captured:', lead);
sendLeadToCRM(lead);
}
});
} else {
console.error('ChatGPTBot is not available.');
}
}
function sendLeadToCRM(lead) {
fetch('https://yourcrm.com/api/leads', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(lead)
}).then(response => response.json())
.then(data => console.log('Lead saved:', data))
.catch(error => console.error('Error saving lead:', error));
}
})();