Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook 'like' referral clicks adding variables; not recognising the page linked as the page liked

So i have a site, Let's call it foo.com and all of the pages have the Like Button plugin on it (same code rehashed on each page)

so I 'like' http://foo.com

Posts on my wall with a link, all fine and dandy

I do the same with my Projects page - http://foo.com/projects

It says in the info when you like it (the drop down that happens as you click like,) that they have 'liked' http://foo.com/projects. All is good; However the actual link on Facebook is :

http://foo.com/projects?fb_action_ids=10151073089123411&fb_action_types=og.likes&fb_source=other_multiline&action_object_map=%7B"10151073089123411"%3A10151036996391185%7D&action_type_map=%7B"10151073089123411"%3A"og.likes"%7D&action_ref_map=%5B%5D

Not only is this ugly, it also means that the like button is not counting for the /projects page, but the new /projects?fbcrap=....

{edit}

Also noticed that you can infact get into an infinite loop.

Person A likes http://foo.com/projects

Person B clicks link http://foo.com/projects from person A's wall Person B liked http://foo.com/projects?randomhashstuff

Person C clicks link http://foo.com/projects?randomhashstuff from person B's wall Person C liked http://foo.com/projects?anotherrandomhash

Result:

  • /projects = 1 like
  • /projects?randomhash = 1 like
  • /projects?anotherrandomhash = 1 like

Where /projects should have 3 likes.

like image 532
Mat Taylor Avatar asked Aug 19 '12 16:08

Mat Taylor


1 Answers

Not only is it ugly, it also means that the like button is not counting for the /projects page, but the new /projects?fbcrap=WHYAREYOUHERE

Put the Open Graph meta tag for og:url into your /projects page, and have it say the page’s URL is actually http://example.com/projects, no matter what kind of query string parameters might be attached.

When Facebook’s scraper will fetch http://example.com/projects?fbcrap=WHYAREYOUHERE when this address is about to be liked, Facebook will realize that the actual address/URL is just http://example.com/projects, and it should therefor count the like for this URL and not something else.

like image 82
CBroe Avatar answered Oct 18 '22 00:10

CBroe