Focus the (web messenger) bot to specific flow when user clicks an element on the website

(Viljami Ketola) #1

I have this somewhat complex idea of how I want my bot to work but I don’t know how to make webhook work with this correctly.

So idea is that I have a website that has a menu on the landing page. My bot is added on this landing site and on all pages that menu-navigation takes the user (so in landing and 4 sub-pages).

I have five flows and I want the bot to focus to correct flow when a user clicks menu-element on the website.

So basically I want to catch a webhook from the website and focus specific user’s view to certain flow.

First I tried to use HTTP/Webhook trigger but I couldn’t figure out what the hell should I put in the response path to make it work so I browsed through internet and found out that webhook trigger for broadcast should work. I tried it and now messages go to all bot users and not only to the one on the page.

So what trigger is the correct for me and if it’s that HTTP/Webhook trigger, what should I put in the response path field?

(Karen Barker) #2

Hi @Viljami_Ketola,

You would need to use the Web Messenger API in order to send metadata into your flow. This can be different on each page of your website and would need to be the value of the flow keyword trigger which you want the user to trigger from that particular page.

You would then have a catch-all flow which triggers based on recieving the start message when the user opens the Web Messenger. Within the catch all flow you would have multiple Trigger a Flow actions each triggering a flow with a keyword trigger based on the metadata which has been sent in on the trigger.

(Viljami Ketola) #3

Thanks, I’ll look into this. It needs a bit more effort to understand since it’s code :nerd_face:

(Viljami Ketola) #4

This seems pretty much what I wanted to do. However, I couldn’t make it work with the inline version of bot. Is it possible to still embed the bot as iframe on the site?

(Daniel Beckett) #5

The Web Messenegr API only works with the widget code unfortunately.