Pages

Monday, December 16, 2013

Embedding your bot on your own website or blog

You are free to embed the bots your create on your own website or blog. It is quite easy to embed a bot, and only takes a few lines of HTML code. You can embed a bot to provide help or service for your website, or as a stand-in for yourself on your blog.

The embedding HTML code can be copied from your bot's Embed page under Admin.

The simplest solution is to embed a bot inside your webpage using an iframe. Here is some simple code to embed Brain Bot in an iframe.

Code to embed a bot in a iframe

See the Talk with Brain Bot tab for an example.

Another option is to put a button or link on your website that open the chat bot in another window. This can be done using a little Java Script code.

Code to popup a bot in window

This code will produce the following:

Talk with Brain Bot

If you know a little HTML or Java Script, you can make how the bot is displayed more sophisticated. One option is to use an absolute position to make the bot popup inside a webpage. This will be demonstrated in the following code.

Code to popup a bot on a webpage

Code to embed a bot without the avatar

You can also choose to not display the bot's avatar and chat log. To do this pass the URL argument avatar=false in your link. You can also pass the welcome message using the message argument, i.e. message=Hello. The welcome message can also be configured from your bot's Training page under Admin.

This code will produce the following:

Talk with Brain Bot

So that's it, you should now be able to embed your bot on your website or blog.

No comments:

Post a Comment