TheMethod
TheMethod

Reputation: 3000

Like url point to page tab

I have a FB app installed as a page tab. The only way the site I am working on is intended to be viewed is within the tab. The site has "entries" , I want to be able to like each entry individually, point to my pagetab and include the entry id as app_data in the query string.

When the landing page receives the post from the page tab I will check check the value of app_data and, if necessary, redirect to the appropriate details page.

So what I tried is when outputting the entries I use the like button like so:

<fb:like  layout="button_count" href="<%= this.GetDetailsUrl() %>"></fb:like>

GetDetailsUrl simply takes the url of my app and appends the entry id as app_data, something like this:

protected string GetDetailsUrl()
{
    return "http://www.facebook.com/mypage/app_myappid?app_data=" + entry.EntryId.ToString(); 
}

Now, what is happening is the like button seems to only point to http://www.facebook.com/mypage , this happens when the like button is clicked and I can see that the like counter for each entry seems to point to the same place, they all have the same count.

Is there a way for me to have a like point to a page tab as I am trying to do? Any advice would be appreciated. Thanks!

edit: After CBroe's suggestions I am using the following on my details page:

<meta property="og:title" content="Entry Title"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="http://www.myredirect.com?id=entry_id"/>
<meta property="og:image" content="http://www.mysite/entryimage.jpg"/>
<meta property="og:site_name" content="http://www.mysite.com"/>
<meta property="og:description" content="Entry Description"/>

Upvotes: 0

Views: 147

Answers (1)

C3roe
C3roe

Reputation: 96412

Is there a way for me to have a like point to a page tab as I am trying to do?

You can not like page tabs, only the fan page itself can receive a like.

What you could do, is set up your entries as Open Graph objects – and then have those liked individually.

And when a user visits your OG URLs, you redirect them to your page tab from there, via JavaScript.

Upvotes: 1

Related Questions