jimstrike/craft-facebook-messenger-customer-chat
Composer 安装命令:
composer require jimstrike/craft-facebook-messenger-customer-chat
包简介
Messenger Customer Chat
关键字:
README 文档
README
NOTE: This Craft plugin is no longer maintained.
On May 9, 2024, Facebook has discontinued its Chat Plugin and you will no longer be able to access any of the functionality of the Chat Plugin.
@see: https://developers.facebook.com/docs/messenger-platform/discovery/facebook-chat-plugin
We recommend using Intercom Messenger instead.
Let people start a conversation on your website and continue in Messenger. Allows your customers to interact with your business anytime with the same personalized, rich-media experience they get in Messenger.
Overview
This plugin allows you to interact with your customers using Messenger by integrating it on your Craft website.
To see and reply to those messages, simply use the same messaging tools you use for your Facebook messaging, on desktop at facebook.com, Facebook Page Manager App (available on iOS and Android), or by adding your page account to Messenger.
You can learn more about Messenger Customer Chat by clicking here.
Key features
- No disconnection: Using the plugin creates a long-lived thread between you and your customers in Messenger. Customers can start a chat on your website and carry on in their mobile device with the Messenger app.
- Chat transcripts are automatically created in the customer’s Messenger account.
- The familiar, modern interface of Messenger builds trust and encourages your customers to engage with you.
- You can use the same Inboxes on desktop and mobile that you use to manage your Facebook page messaging.
- You can set up hours of availability, auto replies and FAQ to serve customers when you’re not available.
Requirements
This plugin requires Craft CMS 4.0.0 or later.
In order to use the Messenger Customer Chat plugin, you will need to have a published Facebook Page. You can find a list of your Facebook Pages by following this link. If you do not have a Facebook Page, you can create one for free here.
Installation
From the Plugin Store
Go to the Plugin Store in your project’s Control Panel and search for "Messenger Customer Chat". Then click on the "Install" button.
With Composer
# Go to project directory cd /path/to/my/craft-project # Tell Composer to load the plugin composer require jimstrike/craft-facebook-messenger-customer-chat # Tell Craft to install the plugin php craft plugin/install fbmcc
Configuring Messenger Customer Chat plugin
After installling the plugin go to its settings in Control Panel → Customer Chat or Control Panel → Settings → Messenger Customer Chat. Read "Getting started" section before customizing and enabling the plugin on your site.
Whitelisting your domain
Before enabling and using "Messenger Customer Chat" you must have a Facebook Page and whitelist your domain on your Facebook Page settings.
Page admins do the following:
- Login to Facebook (if your are not already logged in).
- Go to facebook.com/bookmarks/pages to list your pages.
- Go to your page.
- Click Settings on the left under "Manage Page".
- Click Advanced Messaging on the left under "Page Settings".
- Add your domain under Whitelisted Domains section and click Save.
Find your Facebook Page ID
Page admins do the following:
- Login to Facebook (if your are not already logged in).
- Go to facebook.com/bookmarks/pages to list your pages.
- Go to your page.
- Click Settings on the left under "Manage Page".
- Click Messaging on the left under "Page Settings".
- Scroll down to Your Messenger URL section.
- You will find your Messenger link that looks something like this:
m.me/543210123456789. The numeric part of the URL afterm.me/is your Facebook Page ID.
If the part of the the URL after m.me/ is not numeric then try this:
- Go to frontpage of your Facebook Page.
- Right click anywhere on your screen and then choose View Page Source.
- On page source search for (Ctrl/Cmd + F)
page_id. - The numeric part after
page_id=is your Facebook Page ID.
Let people chat as a Guest
Page admins do the following:
- Login to Facebook (if your are not already logged in).
- Go to facebook.com/bookmarks/pages to list your pages.
- Go to your page.
- Click Settings on the left under "Manage Page".
- Click Messaging on the left under "Page Settings".
- Scroll down to Add Messenger to your website section. and then click Get Started.
- A modal window will pop up.
- Toggle Guest Chat on/off under Guest Chat.
- Click Next until you finish and close the modal window.
Using "Messenger Customer Chat" on your site
Go to "Messenger Customer Chat" site settings, provide your Facebook Page ID and/or code snippet copied from "Facebook page → Settings → Messaging → Add Messenger to your website" and then save. Preview it and adjust its settings until your are satisfied. Enable it.
Advanced configuration
for Craft developers
Override settings
Copy plugin's src/config.php to your project's config folder as fbmcc.php and make your changes there to override default settings.
Print SDK snippet in twig templates
{## # @param int|null siteId (defaults to current site ID) # @param string locale (defaults to plugin´s chat dialog locale setting) # # @return string (Facebook Messenger Customer Chat html snippet) #} fbmcc_sdk_snippet(int siteId = null, string locale = '') craft.fbmcc.sdkSnippet(int siteId = null, string locale = '')
Note: Snippet will only print if plugin is disabled in Customer Chat → Site Settings or
config/fbmcc.phpfile.
Check if enabled in twig templates
{## # @param int|null siteId (defaults to current site ID) # # @return bool #} fbmcc_is_enabled(int siteId = null) craft.fbmcc.isEnabled(int siteId = null)
Note: It will only check against "Opening hours". Checks against "Enabled" or "Sections" won't be made as you are in control of your twig templates.
Twig examples
{{ fbmcc_sdk_snippet()|raw }}
{{ fbmcc_sdk_snippet(currentSite.id, 'en_GB')|raw }}
{# or #}
{{ craft.fbmcc.sdkSnippet()|raw }}
{{ craft.fbmcc.sdkSnippet(currentSite.id, 'en_GB')|raw }}
{# check if enabled first #}
{% if fbmcc_is_enabled() %}
{{ fbmcc_sdk_snippet()|raw }}
{% endif %}
{# or #}
{% if craft.fbmcc.isEnabled(currentSite.id) %}
{{ craft.fbmcc.sdkSnippet(currentSite.id, 'de_DE')|raw }}
{% endif %}
Note: Snippet in the above examples will only print if plugin is disabled in Customer Chat → Site Settings or
config/fbmcc.phpfile. Otherwise a html comment saying that SDK snippet is already initiated will be printed on page source.
Frequently Asked Questions
Where can I find more information on Messenger Customer Chat?
You can find more information on the Messenger Customer Chat page.
What do I need before setting up Messenger Customer Chat on my website?
You will need to have a published Facebook Page, its Page ID and be logged into Facebook on your computer or device.
How does the plugin work?
The plugin is a snippet of JavaScript code that runs on your Craft website. There will be a small Messenger chat bubble that loads with your website in the lower right corner. Your customers can click on it at anytime and message you. It works on both mobile and desktop. You can find more information in Facebook Developer Docs on the Messenger Customer Chat page.
Where can I see all my messages?
On the desktop, you can see all messages in your Page Inbox. Navigate to your Facebook Page on Facebook and click on 'Inbox' at the top. On mobile, you can download the Facebook Pages Manager app and navigate to Inbox. You can also link your Page account to your Messenger app and access all your messages there.
What permissions do I need on a Page to enable the Messenger customer chat feature?
You need be an administrator of the Page.
Can I see messaging analytics for my Facebook page?
On the desktop, go to your Facebook page, and click on Insights on the Navigation bar. On the left hand side, click on Messaging to see your messaging analytics.
Why are some of my users seeing an additional confirmation window after clicking "Chat Now"?
A "Continue As" popup is shown infrequently for security purposes. Most signed-in users will only have to click the plugin itself to opt in, without having to re-confirm. Additionally, as more users message you via the plugin, the "Continue As" popup will be shown less often.
Troubleshooting tips
If you're having trouble getting the plugin to render properly, try the tips below:
-
If you see a console error like "Refused to display in a frame because an ancestor violates the following Content Security Policy directive:", check that the domain of the page the plugin is being rendered on has been whitelisted and that your Facebook Page ID is being entered correctly. Also make sure you didn't set the Referrer-Policy header to no-referrer.
-
The Firefox Facebook Container Add-On prevents the plugin from showing up. Remove the add on if you want the plugin to render.
-
Firefox desktop private browsers (version 63 and above) and Firefox mobile browsers block content tracking by default which will prevent the plugin from rendering. Turn off content blocking (click the gray shield in the search bar) to see the plugin render.
-
DuckDuckGo Privacy Essentials extension will prevent the plugin from shoing up. Remove the extension or turn off Site Privacy Protection if you want the plugin to render.
Craft 3
To use this plugin with Craft 3 you need to install it from the latest v1.* tag version. View all tags.
# Go to project directory cd /path/to/my/craft-project # Tell Composer to load the plugin composer require jimstrike/craft-facebook-messenger-customer-chat:1.1.3 # Tell Craft to install the plugin php craft plugin/install fbmcc
jimstrike/craft-facebook-messenger-customer-chat 适用场景与选型建议
jimstrike/craft-facebook-messenger-customer-chat 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 368 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 07 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cms」 「customer」 「facebook」 「chat」 「Messenger」 「yii2」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jimstrike/craft-facebook-messenger-customer-chat 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jimstrike/craft-facebook-messenger-customer-chat 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jimstrike/craft-facebook-messenger-customer-chat 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Customer handling for PHP applications.
Customers management for Symfony projects.
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
Supercharged text field validation.
统计信息
- 总下载量: 368
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2020-07-19