I'm trying to set up the Facebook comments social plugin. The plugin will be set up so that each product page on our site will have a comments plugin with a unique URL. I want to be able to moderate all the comments together, which should be able to be done with the comments moderator tool on Facebook.
I can put the social plugin on the page with it linked to the respective app ID, but I don't see any comments appear on the moderation tool at: https://developers.facebook.com/tools/comments
The code on the page is this:
<div id="fb-root"></div>
<script type="text/javascript" language="javaScript">
(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#xfbml=1&appId=[appid]";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
Then later...
<meta property="fb:app_id" content="[appdid]"/>
<div class="fb-comments" data-href="http://www.testtesttest.com/" data-num-posts="2" data-width="" data-colorscheme="dark"></div>
It's important to note that for now I'm actually using the URL testtesttest.com
, but I am putting in my actual app ID in the app ID spots.
I do this and can post comments to the page fine. However, I see nothing in the moderation tool. Any suggestions on what I could be doing wrong? Has anyone gotten this to work successfully? I'm not sure if my app is set up wrong, or there is a url match issue, or domain issue. I'm not sure where to start.
Thanks!
I had the same problem and solved it with this:
For moderation tool to work, beside app
<meta property="fb:app_id" content="xxxxx" />
and admin tags
<meta property="fb:admins" content="xxx" />
you MUST add the tags:
<meta property="og:url" content="URL" />
<meta property="og:title" content="TITLE" />
<meta property="og:description" content="DESC" />
<meta property="og:image" content="IMG" />
after that everything worked fine.
I figured out what was going on. I was debugging on my local machine, and it seems that the facebook admin integration wouldn't work there. Once I moved it to a production/visible server the debugger worked: https://developers.facebook.com/tools/debug
I was then able to troubleshoot the main problems and get the comments integrated. It's odd because the commenting itself will work locally. Live and learn I guess.
I tried these solutions but they didn't work for me. After several hours I found the solution. This is the process I followed:
I went to https://developers.facebook.com/tools/debug, put the URL of my app where I had the facebook comments box
The most important information is the final url because this is the page where facebook will look for your meta tags "Final URL is in bold (this is the URL we tried to extract metadata from)".
I noticed that my final url was my sign in page, but I didn't have my meta tags in my sign in page! I had just added the meta tags in the layout I used for facebook comments.
I just added the
fb:app_id
meta tag with my facebook app id in my sign in page, and I finally have my Comment Moderation Tool working.
I am using this meta tags.
<meta property="og:title" content="TİTLE" />
<meta property="og:description" content="CONTENT" />
<meta property="og:image" content="İMAGE URL" />
<meta property="fb:app_id" content="000xxx"/>
<meta property="fb:admins" content="11xxx"/>
First time,comments plugin moderation tool was not working in my page too.
Important! You must add this tag to html code of page.
<html prefix="og: http://ogp.me/ns#">
Then, wait several minute. Write something. Plugin will working.
P.S. Of course you must use "app id" in the javascript codes.
<div id="fb-root"></div>
<script type="text/javascript" language="javaScript">
(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#xfbml=1&appId=[APP İD]";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
No extra tags needed. All it needs it a break of an hour. FB is slow, not sure what it does for an hour but it starts working after some time. Just like some of your friends post show up on your feed much later than they posted. It is working for me after so much of internet reading but with no changes to code (as per original FB documentation code). here is what needs to be done.
Include meta tags in your header file
<meta property="fb:app_id" content="{YOUR_APPLICATION_ID}"/>
add code in your html page
<div class="fb-comments" data-href="http://example.com" data-num-posts="2" data-width="470"></div>
Most importantly, take a long break and dont forget to ctrl+F5 your pages when you come back. I hate this wait time, and so will you.
As others have said IT TAKES TIME for FB to catch up even if you try to trigger the OG parser at https://developers.facebook.com/tools/debug/og/object.
One thing not mentioned by others is to make sure you are actually an admin of the app. I wasn't explicitly listed even though I had create the app myself. So to be sure I added myself here :
Also add some black listed words and enable review. From a non-admin account you can then put a comment like this product sucks
and see if it appears in the review queue. If an admin uses a blocked word it will still appear.
The problem is re-indexing (scraping) 1. Open https://developers.facebook.com/tools/debug/sharing/ 2. Enter and check url 3. Look at section "When and how we last scraped the URL"
If page is not scraped new comments will not be shown in moderation panel. After I have pressed button "Scrape again" comments works fine. Don't forget re-scrape each existing page (new pages works fine).
FB Moderation of COMMENTS ISSUE RESOLVED
<meta property="fb:admins" content="YourFBID"/>
<meta property="fb:app_id" content="YOURAPP ID" />
Specify the meta tags in the head
<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 = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=yourAppId";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="<?php 'YourURL'; ?>" data-num-posts="2" data-width="470" data-colorscheme="light" data-mobile="false"></div>
data-href in the above holds the key for moderation tool.. Its should be just as i have done... Something with the php tags it is.
Solution if you get the following error on the object debugger page:
...'fb:admins' could not be parsed as type 'fbid'.
Using fb:admins with the user slug instead of the user ID
I had the same problem and I don't now why the numeric user ID was not working.
I fixed it using my user "slug" (user name, the alpha numeric one) instead of my user ID (the numeric one).
You can find you user "slug" when accessing a user timeline:
www.facebook.com/first-name.last-name
Then update your page with:
<meta property="fb:admins" content="first-name.last-name" />
Check that everything is ok on the Facebook object debugger page: https://developers.facebook.com/tools/debug/og/object/
Click the "fetch new scrape information" button.
And that's it, go back to your page and enjoy the moderation feature.
It might seem stupid, but: the site you want the comments to appear on has nothing to do with the facebook site that counts the likes! I made my mistake with this myself.
So: in order to see the moderation correctly and for the comments to appear where they should be; the URL part of the data-href="...."
has to be THE SITE FOR THE COMMENTS TO SHOW UP.
For example:
<div class="fb-comments" data-href="HTTP://WWW.THE-SITE-FOR-THE-COMMENTS-TO-SHOW-UP.COM/" data-numposts="5"></div>
I found that these are enough for the moderation to appear:
<meta property="fb:app_id" content="123456789123456" /> <!--for example -->
<meta property="fb:admins" content="the.admins.fb.id" /> <!-- whatever there is after the fb.com/ -->
<meta property="og:url" content="http://www.the-site-you-want-the-comments-to-appear.example/" /> <!--for example -->
...
This only worked for me when I changed my data-href
to https
. My app doesn't want to connect unless my url is https. My site does have ssl but comments were already configured with the http
urls.
来源:https://stackoverflow.com/questions/9120814/comments-plugin-moderation-tool-not-working