Facebook messenger plugin is changing language - facebook

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

Related

Messenger plugin not visible in a dev mode

I'm trying to add regular messenger plugin to the website: https://outrainer.pl
I have added standard code:
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '1957690761027872',
autoLogAppEvents : true,
xfbml : true,
version : 'v7.0'
});
};
</script>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script>
<script>
(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'));
//FB.CustomerChat.showDialog();
</script>
and required div:
<div class="fb-customerchat"
page_id="100751868404123">
</div>
However I can not see a plugin. Moreover when I try to run "FB.CustomerChat" from webcsonsole, it returns "undefined". What am I missing?
https://developers.facebook.com/docs/messenger-platform/discovery/customer-chat-plugin/ or use the code generated via the setup tool in your page settings. The Customer Chat Plugin doesn't use the regular SDK anymore.

Facebook customer chat plugin not appearing

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

HTML code invalid. How can I add facebook messenger code with google tag manager?

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 to refresh page for FB messenger widget to show on web page

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>

Facebook comments not working on Wordpress

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?