Setting up Mixpanel
- Create an account and a project in Mixpanel.
- Go to your project settings and copy the Project Token.
Setting up the Hooks
- Open Botpress Studio, go to the Hooks tab and click on the
+button next to Before Incoming Message to create a new hook. - Name it
send-user-analyticsfor example - Add the following JavaScript code:
- Click on the
+button next to Before Outgoing Message to create a new hook. - Name it
send-bot-analyticsfor example - Add the following JavaScript code:
NoteNow every time a user or the bot sends a message, Mixpanel will be notified with the event data. You can use this data to create funnels, analyze user behavior and understand the paths they take when interacting with the bot.