Comments (10)
This is how I do it:
<script src="https://cdn.botpress.cloud/webchat/v1/inject.js"></script>
<script src="https://js.zohostatic.com/creator/widgets/version/1.0/widgetsdk-min.js"></script>
<script>
ZOHO.CREATOR.init().then(function() {
var queryParams = ZOHO.CREATOR.UTIL.getQueryParams();
window.botpressWebChat.init({
"composerPlaceholder": "xxx",
"botConversationDescription": "xxx",
"botId": "xxx",
"hostUrl": "https://cdn.botpress.cloud/webchat/v1",
"messagingUrl": "https://messaging.botpress.cloud",
"clientId": "xxx",
"webhookId": "xxx",
"lazySocket": true,
"themeName": "prism",
"botName": "xxx",
"avatarUrl": "xxx",
"termsConditions": "xxx",
"privacyPolicy": "xxx",
"emailAddress": JSON.stringify(queryParams.email),
userData: {
email: JSON.stringify(queryParams.email)
},
"website": "xxx",
"stylesheet": "xxx",
"frontendVersion": "v1",
"useSessionStorage": true,
"showBotInfoPage": true,
"enableConversationDeletion": true,
"theme": "prism",
"themeColor": "#2563eb"
}); });
</script>
from botpress.
I do the same type of thing with Zoho Creator instead of Wordpress. It works for me... where "works" is defined as "I see the custom userData values in the logs when I use console.log() on them".
You didn't mention what error you're facing or why you say it's not working.
from botpress.
Thanks for your response. Actually, for the very beginning its not passing the user name.
eg if i am customer who have already account on wordpress and if open website then botpress should need to call me hey Pankaj Welcome back
from botpress.
Is there is any thing that need to be done on the botpress end ? like any configuration that need to be done on the botpress
from botpress.
from botpress.
That doesn't look related.
from botpress.
Is there is any thing that need to be done on the botpress end ? like any configuration that need to be done on the botpress
Just enable the webchat integration
from botpress.
Yes already done and i am passing username but chatbot not greetings with that name, when I am passing name like you mentioned above bot not doing any thing
from botpress.
Hey @pks891618, sorry for the late reply.
This is your code ?
<title>My Basic HTML Page</title>
<script src="https://cdn.botpress.cloud/webchat/v1/inject.js?i=213132123123"></script>
<script> function initializeChat(userName) {
console.log("inside function:", userName)
window.botpressWebChat.init({
composerPlaceholder: "Chat with bot",
botConversationDescription: "This chatbot was built surprisingly fast with Botpress",
botId: "915398e7-3cb8-43fe-8873-8e7a30a0c16f",
hostUrl: "https://cdn.botpress.cloud/webchat/v1",
messagingUrl: "https://messaging.botpress.cloud",
clientId: "",
webhookId: "",
lazySocket: true,
themeName: "prism",
frontendVersion: "v1",
useSessionStorage: true,
showPoweredBy: true,
theme: "prism",
themeColor: "#2563eb",
userData: { name: userName, },
});
}
function getUserNameAndInitializeChat() {
let userName = localStorage.getItem('user_name');
// Check if the username exists in localStorage
if (!userName) {
userName = prompt('Please enter your first name:');
if (userName) {
// Save the username to localStorage
localStorage.setItem('user_name', userName);
initializeChat(userName);
}
} else {
const myTimeout = setTimeout(initializeChat(userName), 2000);
console.log(userName);
//initializeChat(userName);
}
}
// Call the function to get the dynamic value for userName and initialize chat
getUserNameAndInitializeChat();
</script>
If so, the userData
feature was broken until Wednesday (march 20). @EFF made the fix and it should be working now.
Let us know if it works on your end.
from botpress.
@pks891618 I'll close this issue, feel free to reopen if needed.
from botpress.
Related Issues (20)
- JavaScript heap out of memory when running pnpm run check HOT 3
- Feature request - optin and handover (Messenger) HOT 3
- Huh HOT 2
- GeOrGrabber HOT 1
- Comparto '6OaYP3rg' contigo
- Delete my botpress.cloud accounts HOT 2
- Advanced WhatsApp Support HOT 2
- Feature Request - Matrix Support HOT 2
- Get User Data not working HOT 27
- Botpress - open source HOT 1
- Can no longer deploy integration after adding hub.md file HOT 2
- error parsing template SyntaxError: Unexpected token '}'
- Bot stops responding after more than 60 seconds of execute code processing HOT 1
- Using botpress studio on prem - how to add users HOT 1
- Error with Botpress repository HOT 1
- request/body must have required property 'userId' - Webhook Trouble HOT 2
- Documentation - Docs Should Follow its Own Advice to Implement All Message Types HOT 2
- Unhandled Promise Rejection trying to call the action whatsapp:startConversation
- Isn't child_process package available? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botpress.