Here’s the code, direct from Facebook:
<!– Load Facebook SDK for JavaScript –>
<div id=”fb-root”></div>
<script>
window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : ‘v5.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_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=”#e1a755″
logged_in_greeting=”Hi! What can we do for you? Message us and we’ll get back to you.”
logged_out_greeting=”Hi! What can we do for you? Message us and we’ll get back to you.”>
</div>