views:

141

answers:

1

What does Facebook make of 'Like' buttons in a ajax web app if they are referring to the same page but with a different # string?

Does it treat them as different pages to 'like'?

for example if i get 4 like clicks:

mysite.com/articles#story1
mysite.com/articles#story2
mysite.com/articles#story3
mysite.com/articles#story4

what will come up in the users' newsfeed

4 people like mysite.com/articles

or

dave likes mysite.com/articles#story1
tom likes mysite.com/articles#story2
ben likes mysite.com/articles#story3
nick likes mysite.com/articles#story4

are there any other things to think about with FB and # strings?

+1  A: 

Facebook's like buttons use metadata that are embedded in the HTML markup of a single page. It would work in theory if your URL's produce different metadata when accessed by curl (i.e. without JavaScript, which I believe is not possible since the hash portion is not seen server-side, so there is no way to act on hash string values server side).

So having said that, I would assume that Facebook Like buttons don't behave differently for different hash strings. A look at the facebook documentation (which mostly sucks) doesnt mention this, but the facebook developer forums seem to confirm this: http://forum.developers.facebook.com/viewtopic.php?pid=240151

However, all is not lost. You can specify the URL of a like button, so just set the URL to be the SEO-friendly URL of the same page: http://developers.facebook.com/docs/reference/plugins/like

UPDATE - Clarifying from the comments

So, now that we know you have static versions of the hash string URLS. Before, you were most likely placing like buttons on the page with this code:

XFBML:

<fb:like show_faces="false" width="450"></fb:like>

Instead, you should be specifying the SEO version of the URL. For example, when you're on mysite.com/articles#story4, the code should look like:

XFBML:

<fb:like href="mysite.com/articles/story/4" show_faces="false" width="450"></fb:like>
Mike Sherov
what if you're ajaxing-in the new meta data on click along with other ajax'd content? i agree with you about the poor state of fb docs/community!
Haroldo
@Haroldo, AJAX is javascript, and isn't accessed by cURL. It needs to be in the document that is originally loaded before any javascript manipulation. Same rules as search engines.
Mike Sherov
It's not so much that these are SEO-friendly links but more so that they are critical to the loading of the correct page. They are required, not optional.
Brian David Berman
@Brian, what I'm saying is that the OP should make a corresponding version of the page that doesn't rely on hash values.
Mike Sherov
@mike yep i have a corresponding non-ajax version of the content. Are you saying i can remotely like those pages?
Haroldo
@Haroldo, what I'm saying is that you can generate a like button specifying the SEO-Friendly version of the URL. I'm updating the answer to show you.
Mike Sherov