Proactive message

Hey…
I just want to pop message anything or without typing initially the flow will start. How can I do that.? I’m using V12.2.3 and I refer the proactive trigger in the document. But I don’t know where I should attach the code. Can anyone help me to do it :grinning:

Thank you

You should add below code in your website where you want your bot to appear.

...
<head>
    <script src="http://localhost:3000/assets/modules/channel-web/inject.js"></script>
</head>
...
<script>
      window.botpressWebChat.init({
        host: 'http://localhost:3000',
        botId: 'test_bot'
      })
      window.addEventListener('message', function(event) {
        if (event.data.name === 'webchatOpened') {
          setTimeout(function() {
            window.botpressWebChat.sendEvent({
              type: 'proactive-trigger',
              channel: 'web'
            })
          }, 1000)          
        }
      })
</script>

Please check this guide for more information.

Thank you very much :+1: