- This topic has 5 replies, 3 voices, and was last updated 3 years, 11 months ago by Tom.
-
AuthorPosts
-
March 17, 2020 at 3:00 pm #1197785David
Hello, i want to put Facebook Messenger un my website and Facebook send me a Code to put on muy web. They told me that i must to put on the body of the Pagés where i want yo use It. can i put this Code/script using a hook? If you think what i can do it… What hook i must to use? And can i use a hook for using Facebook Messenger with all the pages in mi website. Thanks a lot for your help in advance.
This is the Facebook Messenger Code:
<!– Load Facebook SDK for JavaScript –>
<script>
window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : ‘v6.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><!– Your customer chat code –>
<div class=”fb-customerchat”
attribution=install_email
page_id=”534723616958263″
theme_color=”#20cef5″
logged_in_greeting=”Hi! How can we help you?”
logged_out_greeting=”Hi! How can we help you?”>March 17, 2020 at 4:57 pm #1197845LeoStaffCustomer SupportHi there,
I believe the javascript code should go in the
wp_footer
hook:
https://docs.generatepress.com/article/hooks-element-overview/Then the
<div>
would go wherever you’d like the chat to appear:
https://docs.generatepress.com/article/hooks-visual-guide/March 20, 2020 at 2:28 am #1200310DavidThanks for the quick reply.
Using gp hooks, I have put the complete code in one of the websites where you have told me; wp_footer and it has worked perfectly.
However, on the other website I have, which is almost a clone of this one but with another domain name and very similar, same plugins… etc, it doesn’t work and facebook says that plugin must run with the two sites:“facebokk says”
1. Confirm your website domain name appears
The website domains listed below are able to display the customer chat plugin for EPM Pools & Construction. Ask Jack Cosson if you don’t see the website listed.https://epm-construction.com/en/home/, https://epmpools.com/en/home/
2. Install the plugin
Simply paste the code snippet below into your website code. We recommend placing the code after the opening <body> tag on pages where you want the plugin to appear.and the code explained above…..
any ideas?
Thanks a lot in advance again
March 20, 2020 at 4:10 pm #1201087TomLead DeveloperLead DeveloperHi there,
The first message sounds like you haven’t confirmed ownership of the website. Have you taken all of the necessary steps with this second website?
If they want the open after the opening
<body>
element, you should choose thewp_body_open
hook.April 28, 2020 at 1:41 am #1259056DavidThanks for your reply. Something wrong with Facebook adding the second site. You reír Tom. Thanks a lot
April 28, 2020 at 9:49 am #1259880TomLead DeveloperLead DeveloperNo problem!
-
AuthorPosts
- You must be logged in to reply to this topic.