PDA

View Full Version : Possible Solution for "Facebook issue"



Deepabysm
02-26-2013, 11:05 PM
Hey,
recently, I had some issues regarding Facebook's OpenGraph and finally figured out what was wrong. Although, I was not able to solve the problem that if I like a picture, all images are apparantly liked by me. But I looked at the Facebook Object debugger and I may have found something which could be interesting.
Having my start page set as og:url, the object debugger displays the following:


Fetched URL: http://example.com/file/actualimagepath
Canonical URL: http://example.com/

I am not an OpenGraph expert but I can imagine that when I now like any image on my page I actually like the URL given in the og:url tag, which is of course http://example.com
Therefore liking another image is not possible, because I don't actually like the image but the whole page. This is also displayed on Facebook: I like an image and my Facebook news stream says something like "Deepabysm likes <place og:title attribute here> on <place og:url attribute here>.

Now I was wondering what could resolve this issue and I finally thought that some php in the <head> area, specifically at the og:url and the og:title tag could solve this. Creating some php that makes og:url and og:title variable may solve the whole problem I guess. I am not sure though.

Besides that I wanted to say that when I comment on a picture of mine, it does notget posted on facebook and I don't know why.

mikemayhem3030
02-27-2013, 12:05 AM
Hello Deepabysm

I'm Mike, developer over at Epic Plugins (http://epicplugins.com/) you're along the correct lines here when you click a like button it does usually look for the og:url meta.

Now I've not delved too deep into the Social Gallery code but what it should be doing (and I'm pretty sure it is) is when you have Social Gallery pages, the like buttons comment boxes on each image are using the data-href = "socialgallerypageURL' so when someone clicks it they're actually liking the Social Gallery pages and the likes will be unique.

Assuming Woody has setup the SocialGallery pages using the facebook opengraph meta tags in the head (again, he's a top notch programmer I'm sure he will have done this) then it will work correctly.

Check out his blog post here: http://www.socialgalleryplugin.com/social-gallery-pages/

So I guess what I'm trying to say is... are you still seeing the oddity of only the page being linked when you have Social Gallery Pages set?

If you're using a fallback URL (i.e. don't want the Social Gallery pages) you should pick the image URL (this way it will like the upload location of the images).

Mike

Deepabysm
02-27-2013, 12:56 PM
Hey Mike,
thanks for linking me the blog post! I wasn't really aware that SocialGallery puts "its own" OpenGraph meta tags in the <head> area. I implemented them into my header.php by myself and then the "canonical URL" was the URL which was given in the og:url thing.
Having had a look on the object debugger again, I removed every OpenGraph tag I put manually in the header.php (except fb:app_id ) and now it works fine. Thanks a lot! :)

Edit: I just figured out that commenting on an image still doesn't get posted on facebook. Any ideas?

mikemayhem3030
02-27-2013, 04:36 PM
Hey Mike,
thanks for linking me the blog post! I wasn't really aware that SocialGallery puts "its own" OpenGraph meta tags in the <head> area. I implemented them into my header.php by myself and then the "canonical URL" was the URL which was given in the og:url thing.
Having had a look on the object debugger again, I removed every OpenGraph tag I put manually in the header.php (except fb:app_id ) and now it works fine. Thanks a lot! :)

Edit: I just figured out that commenting on an image still doesn't get posted on facebook. Any ideas?

Couple of things I've noticed with this

1.) The facebook comment plugin now has a tickbox (default unticked) for "post to facebook" - if Social gallery hides this popout box via CSS users may not see it to tick it and I don't think you can set it as tick by default.

2.) Are you sure they're not being added but hidden away in your timeline?

Deepabysm
02-27-2013, 04:57 PM
I already had the tickbox ticked.
However, 5 minutes ago Social Gallery or whatever crashed and all the settings were set to default (and I did NOT do this), I reentered all my stuff and now it works. :D
Thanks anyway!

Deepabysm
02-27-2013, 05:42 PM
Sorry for double posting but I have to revise my previous post. It did work indeed but only with the standard app-id. If I add my own app-id, comments are not posted on facebook. Do I have to change something in the facebook application?

//edit: solved

woods
03-03-2013, 04:11 PM
Hi Deepabysm,

Could you share how you solved this one please?




Cheers!

Deepabysm
03-03-2013, 05:49 PM
I don't really know. The one day it didn't work and the other day it did. Maybe I was just too impatient.

woods
03-05-2013, 09:02 AM
I don't really know. The one day it didn't work and the other day it did. Maybe I was just too impatient.

Awesome to hear its solved anyway! Going forward v2.1 will be much more stable and will hopefully sidestep a lot of these common issues, at least that's thoroughly my intention.

Thanks again for taking the time to post Deepabysm!


@Mike - thanks as well dude!