Open web widget via link

#1

Hi,

there’s a lot of info on the web widget around in this forum, but I couldn’t really make sense of what I was finding, sorry for that! My questions are:

  • Can I have a link on my page that opens the web widget in the sidebar?
  • If so, what kind of meta data can I pass on with this link and how exactly is this done (non-coder here)?
  • Can I disable the default web widget and if so, how is this done exactly?

Thanks so much for your help!

(Nathan Stults) #2

So, as a non-coder, your options will be limited because all of the ways you can customize the default widget experience the way you are asking about require at least some HTML coding. I believe that you can create a link in HTML that has a target that targets an iFrame, if that link were the link to our bot widget, you may be able to accomplish that part without code.

Either way, you can pass in any metadata you want to the bot using query string parameters in the bot URL.

You can also do both of these things with the Java Script API.

I don’t think you will need to disable the widget in this scenario - you will not be embedding the widget at all, but instead, loading it in a iFrame. On the last page of your bot config there are three different snippets provided - a snippet to embed the widget as a button (the normal experience), a snippet for the code you would need to add the bot as an iFrame, and the raw url to the bot hosted on its own page.

Nathan

#3

Thanks for the quick response, Nathan! Will look into this.

I don’t think you will need to disable the widget in this scenario

Sorry, I was imprecise here. I meant whether the icon of the web widget can be disabled? And if so, could you point in any direction on how to do this via Javascript? (What I want to achieve is to hide the icon and open the web widget in the sidebar via a link on my webpage.) Very willing to learn… Thx!

#4

Sorry to ask again, but I still don’t fully understand this (and needed almost a year to reflect things :wink:): I want to embed the chat widget on a website and open it with a link on this website to start a special flow (instead of asking the user to click on the widget icon). Is there a way to achieve this? Thanks so much!

(Nathan Stults) #5

I see - yes there is a way to achieve that, with some custom JavaScript coding.

The Web Messenger API has several methods you can here:

create - this lets you open the messenger panel and hide the icon
destroy - the reverse, closes the messenger and shows the icon
toggle - closes if open and opens if closed

You can associate your hyperlink with a javascript method that calls the appropriate Web Messenger API method. As for starting a special flow, you can also use the same API to send a specific message text to Flow XO using sendMessage, and this can in turn trigger a specific flow.