master_template/resources/views/shortcodes/fb_chat.blade.php

41 lines
1.8 KiB
PHP
Raw Permalink Normal View History

2024-06-10 12:21:58 +00:00
<!-- Messenger Chat Plugin Code -->
<!--<div id="fb-root"></div>-->
<!--<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#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=install_email-->
<!-- page_id="106003908524549">-->
<!--</div>-->
<!-- 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", "<?php echo $page_id; ?>");
chatbox.setAttribute("attribution", "biz_inbox");
</script>
<!-- Your SDK code -->
<script>
window.fbAsyncInit = function() {
FB.init({
xfbml: true,
version: 'v12.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_GB/sdk/xfbml.customerchat.js';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>