ご存知でしたボットのリブレー無料主催 ライブチャット のためにお客様ご自身のウェブサイトまたはモバイルアプリのか?
FAQ

How to make bot greet the user when the page loads?

による admin 掲載 Oct 3 2016, 15:20

When you embed a bot on a webpage using the "Box" embedding option it will put a chat box on the bottom corner of your page.

The embedding code that you can get from your bot's Embed button contains the HTML/JavaScript code you need to paste into your webpage to embed your bot.

You can add additional code to the embed code in JavaScript, HTML, or CSS to change its behavior or look and feel.

One option is to make the bot greet the user after the page loads, or after a certain amount of time. In JavaScript you can use a timeout for this.

For example:
window.setTimeout(function() { web.maximizeBox(); }, 1000);

Here is the full code example (enter your application id and bot id):

<script type='text/javascript' src='https://www.botlibre.com/scripts/sdk.js'></script> <script type='text/javascript'> SDK.applicationId = "1234"; var sdk = new SDKConnection(); var web = new WebChatbotListener(); web.connection = sdk; web.instance = "123"; web.instanceName = "My Bot"; web.prefix = "botlibre"; web.caption = "Chat Now"; web.boxLocation = "bottom-right"; web.color = "#009900"; web.background = "#fff"; web.bubble = true; web.backlink = true; web.createBox(); setTimeout(function() { web.maximizeBox(); }, 1000); </script>


Id: 14125736
タグ: embedding, javascript, faq
掲載: Oct 3 2016, 15:20
更新: Oct 3 2016, 15:22
回答: 0
眺望: 4693, 今日の: 2, 週間: 10, 月: 58
3 0 5.0/5