[英]Facebook Messenger website plugin greeting_dialog_display not working
[英]Facebook Messenger on website with different greeting message for each page
我只是想知道是否可以根據您在網站上的頁面在信使上設置不同的問候消息?
我知道當我們在 facebook 上設置嵌入代碼時,我們可以預定義歡迎消息。
https://developers.facebook.com/docs/messenger-platform/discovery/customer-chat-plugin/這就是它的設置方式。
天哪。 又想多了。。沒想到這么簡單。 我什至試圖建立一個聊天機器人來實現這一點。 初始化聊天時,可以將登錄和退出問候消息設置為屬性!
<div class="fb-customerchat"
attribution=setup_tool
page_id="YOUR_FB_PAGE_ID"
theme_color="#2e3291"
logged_in_greeting="Hello! We are here to answer any questions you may have."
logged_out_greeting="Hello! We are here to answer any questions you may have.">
</div>
如果您知道要顯示消息的消息和頁面,則可以使用 else if 條件控件來顯示消息,例如:
if (location.href == x.com) {
// set message here
} else if (location.href == y.com) {
// set alternative here
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.