问题
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.
回答1:
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.
回答2:
Looking here, it looks like you should specify the href
in the like button:
<fb:like href="http://pandaz.co.uk/projects/" width="450" height="80"/>
Also, you should consider reorganizing the og:
meta data on the top of the HTML, just after the title
in the header
.
Cheers, Apoc
回答3:
I'm pretty sure that's intentional, the extra parameters allow you to identify which 'like' triggered the story that the (inbound) user saw, and tell you where on Facebook they saw it and clicked it.
There's documentation showing many of the possible fb_source
parameters ( https://developers.facebook.com/docs/fb_source/ ) and fb_action_ids
and fb_action_types
contains the Open Graph action types and ids which contributed to the story the user clicked (i.e X liked Y and Z other pages on SiteName' will have multiple action IDs representing each like button clicked)
{edit} and as CBroe said, the way to fix this is to have a set of Open Graph meta tags on your site which tell Facebook the URL of the content/object itself, even when it's accessed with additional query string parameters
来源:https://stackoverflow.com/questions/12028116/facebook-like-referral-clicks-adding-variables-not-recognising-the-page-linke