How to Monitor and Transfer User Conversations:
# 🤝help
a
The time has come to put my chatbot into action, and we're really excited to see it working on our website. 🚀 Once my bot is live, how can I monitor the conversations with users? Is it possible to transfer the conversation to a real agent?
Hey guys, is there any instruction regarding this topic?
a
@ambitious-vr-9887 That's a great question. Right now there is no built-in way to do that, I think it's an upcoming feature. I create a Before Outgoing Message hook like this for my bot, and check the logs.
Copy code
console.log(`:envelope::envelope::envelope: message from userId ${event.userId}:
user : ${event.payload.text}
bot : ${outgoingEvent.payload.text}
:speech_balloon::speech_balloon::speech_balloon:`)
You can call axios in here, so you could send this to any DB of yours. Even something like GA4 or Mixpanel works! If you output multiple messages for a single user message, you might want to split this in two (After Incoming Message and Before Outgoing Message) though. Let me know if you need more info on doing this
a
I see, thanks for the information! So at the moment the only data we have as analytics are the ones we have in on our workspace area?
Currently we can't access the chats users have with our bots?
a
Yes, that's correct, but also, I forgot to mention, you can get the conversations via API too : 1. list conversations -> https://botpress.com/docs/api/#conversation-list-conversations 2. then, for each -> https://botpress.com/docs/api/#message-list-messages
a
That's good to hear, thanks for the help, I'll check these links!
Hi @acceptable-gold-88171, could you talk a bit more about how to access users conversation history with the chat? I'm sorry, It's still a bit difficult to grasp the step-by-step process.
Do you plan to release a tutorial about this soon? I feel some people have this question, and more may have it in the future, thanks for the support! 🙏
a
Hi @ambitious-vr-9887 ! I've created a feature request to have this be part of the product. This is going to be easier than to teach everyone how to use the API. 🙂 You can upvote it here https://discord.com/channels/1108396290624213082/1117819709690220584/1117819709690220584 In the meantime, to use the API, you need a token which you can get from app.botpress.cloud. then you do a GET request to https://api.botpress.cloud/v1/chat/conversations with a header called "Authorization" and a value of "Bearer {ACCESS_TOKEN}", substituting your ACCESS_TOKEN and no quotes. @salmon-art-82621 @late-breakfast-99706
e
Hey Artu I made a custom inbox that uses the official API and might help you for now until they release an official one.
Check it out the github repo. It has all the instructions for setting it up
a
@early-train-33247 Wonderful tool! Thanks so much for making this!!
a
@early-train-33247 this is going to help a lot, thank you so much for sharing with us!!!
e
My pleasure guys!
s
Hello @early-train-33247 ! Thank you very much for your solution, and I did everything exactly as you described. I copied the project folder to the root directory, implemented everything in the .env file, but when I access index.html from your folder, it only shows me a blank webpage. Did I do something wrong? Thank you so much for your help, as the conversation between the bot and the visitor is essential for question and answer purposes.
e
Hey @salmon-art-82621! You have to start the project using Vite, it compiles the javascript code to build the app. You should open the project folder in the terminal (the VS Code integrated one is great), and run
npm run dev
. Then the app will open at localhost:5173, and you will be able to list the conversations!
Let me know if that helps
s
Ah, okay, that seems to be more complicated than I thought 😉 But thank you very much, I will give it a try and I'll definitely let you know.
@early-train-33247 Great! 🎉 It works with Vite. You're the best, thank you so so much! I hope at Botpress will be create a feature soon to directly see the conversation in the backend.
e
Good to know! 🚀 They are working on an official Inbox as we speak, stay tuned!
I forgot to explain that you were opening the uncompiled/unbundled app, that's why it was a blank page.
s
I do it! 😊
51 Views