I have flash able dashboard system CRM. I want to implement Facebook Live chat (Just Like customer Support)
So I want to that the facebook live chat can be access from the Flash Able CRM directly to chat with customers.
Does Facebook have live chat Api to be used in our CRM or any application
Can anyone help me in this
enter image description here
Here is the image where i want to implement facebook live chat and i can chat to my customers from this flash able Admin dashboard
you need to read the official documentation : https://developers.facebook.com/docs/messenger-platform/discovery/facebook-chat-plugin/
<!-- Messenger Chat Plugin Code --> <div id="fb-root"></div> <div id="fb-customer-chat" class="fb-customerchat"></div>
<script>
var chatbox = document.getElementById('fb-customer-chat');
chatbox.setAttribute("page_id", "PAGE-ID");
chatbox.setAttribute("attribution", "biz_inbox");
</script>
<script>
window.fbAsyncInit = function() {
FB.init({ xfbml : true, version : 'API-VERSION' });
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
Related
I inserted fb messenger plugin code in my website. Whenever I am clicking this plugin, the language changes. I am not using VPN. I also checked my IP address and it is located in my country. Even on mobile device, the language changes.
This helped me. I changed URL in SDK code the js.src parameter from:
js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js';
To:
js.src = 'https://connect.facebook.net/en/sdk/xfbml.customerchat.js';
Notice that in the first URL there is /en_US/ and in the second there is only /en/. Now I have Facebook chat in english. Still better than random foreign language. I'm following this thread for better solution.
My code:
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : 'v4.0'
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en/sdk/xfbml.customerchat.js';
//js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- Your customer chat code -->
<div class="fb-customerchat"
attribution=setup_tool
page_id="{Your page id}"
theme_color="{Your theme color}"
logged_in_greeting="Hi! How can we help you?"
logged_out_greeting="Hi! How can we help you?">
</div>
Here is my solution
Set up a new Chat plugin again, and choose English UK instead of default English us. It worked for me. check this image Click to View
Their latest Chat Plugin v14 is unstable, switch to an older version. I'm on v6 and there's no language issue.
<!-- Messenger Chat Plugin Code -->
<div id="fb-root"></div>
<!-- Your Chat Plugin code -->
<div id="fb-customer-chat" class="fb-customerchat">
</div>
<script>
var chatbox = document.getElementById('fb-customer-chat');
chatbox.setAttribute("page_id", "000000001");
chatbox.setAttribute("attribution", "biz_inbox");
</script>
<!-- Your SDK code -->
<script>
window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : 'v6.0' // <----- Change version here
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
If the problem is still occurs, you can override the src like this, add
?locale=en_US or any language you like at the end of url
https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js?locale=en_US
Am trying to implement Facebook customer chat plugin(which is generated by facebook) in JSF project, but when I insert the code snippet ... I don't get anything, no errors, no chat bubble, yet I can see a generated div with it's data
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : 'v3.3'
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- Your customer chat code -->
<div class="fb-customerchat"
attribution="setup_tool"
page_id="*********"
theme_color="#44bec7"
logged_in_greeting="Hello, speak with us"
logged_out_greeting="Hello, speak with us">
</div>
it should be noted that I had to add double quotes for setup_tool as JSF was throwing error attribution="setup_tool"
It's working after adding
appId: '*****',
autoLogAppEvents : true
to FB.init
Here's a code that I got from facebook chat plugin messenger.
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : 'v3.3'
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- Your customer chat code -->
<div class="fb-customerchat"
attribution=setup_tool
page_id="my-page-ID">
</div>
Google Tag manager send me an alert, that this code is invalid.
What should I do with this?
How can I add this code with Google tag manager?
I have been trying to add FB Messaging Widget to my site. All works fine on MS Edge but I have to hard (CTRL + F5) refresh the page when viewing the page on Chrome and my Android Phone. If I leave the page and come back to it again I have to once again hard refresh the page for it to show up. Your help would be appreciated.
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '2107772995957885'
xfbml : true,
version : 'v3.2'
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js#xfbml=1&version=v2.12&autoLogAppEvents=1';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- Your customer chat code -->
<div class="fb-customerchat" attribution=setup_tool page_id="123456789" logged_in_greeting="Hi, Thanks for visiting our site. If you have a question, please ask here." logged_out_greeting="Hi, Thanks for visiting our site. Log into FB to ask a question." greeting_dialog_display="fade" greeting_dialog_delay="10" theme_color="#ff7e29"></div>
I added Facebook Comment Box to my site manually. I created an app and pasted the code on my template files.
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : '730627806953221', // App ID from the app dashboard
status : true, // Check Facebook Login status
xfbml : true // Look for social plugins on the page
});
// Additional initialization code such as adding Event Listeners goes here
};
// Load the SDK asynchronously
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
Then I added this:
<div class="fb-comments" data-href="<?php the_permalink(); ?>" data-width="430" style="max-width: 100%;"></div>
It seems to work, when a user comments it displays correctly. However when I try to reply to someone who left a comment it doesn´t stay there. I´m trying to reply as a brand not as myself.
Why could this be?