Hello! I am trying to include a unique ID for each bot message. The reason why I need this ID is because I want to implement a user feedback/rating feature for all of the bot answers. Currently, I can’t match the front-end bot message with the event saved in the tracker store.
To do this, I implemented a custom connector channel that was supposed to include a unique ID in the message sent through the output channel. However, I don’t know how I should save that message together with the generated unique ID in the tracker store. Even if I implement a custom tracker store, there is basically no way to save the unique ID to the tracker store from the output channel.
I am very confused as to why there is no simple way to include additional fields to the bot messages. One could do this using custom actions, but it is a really ugly solution.
I found out a “primitive” solution: one can basically send the timestamp of the bot reply by implementing a custom output channel. The timestamp and the user ID will be the unique identification data for a message on the front-end. These two fields will be sent as part of the feedback/rating request to the back-end, where a SQL query will find the matching event in the “events” table (tracker store) if the following conditions are fulfilled:
sender_id == user_id (where the user ID is sent from the front-end)
MAX(timestamp) <= rated_message_timestamp, where rated_message_timestamp is the timestamp that was initially sent through the custom output channel. The reason why I need the MAX is because I noticed that the event timestamps saved in the tracker store (the “events” table) are always smaller than the timestamp generated by using datetime (the one that was sent through the output channel to the front-end).
After finding the matching event, I can store the user feedback and the rating in a separate table. This is the only way to uniquely identify bot messages and support the user feedback feature for now. It is incredibly hacky and not a pretty solution at all. I wish someone would implement this feature, since it’s ubiquitous in most chatbots.