Sharing links behind a walled garden on Facebook - facebook

I have website that will both post to a user's Facebook wall, and allow him/her to share links through private Facebook messages.
The links that we would like to share can be behind a walled garden, meaning you'd have to be logged in to our site to see them. The problem is Facebook ends up sharing the redirect link instead of the original.
What is the correct way to handle this use case?

You need to generate "fake" pages with the og meta tags, and with a meta refresh, url tag, or some script with document.location. This pages should not need log in, and must contain only the shared information.

Related

Facebook: Share story without adding link to resource

I would like to make users to be able to post stories to their timeline but with no links to any resources. Using Facebook example:
I would like this post not to have any links. If someone using facebook on a browser clicks the image or the Cookie! title, they will be redirected somewhere. In my case, they are directed to an URL on my api which stores object data as meta tags from where FB scrappes the information (in this case, a blank page where the headers describe the Cookie! object). Is this even possible? I am developing an app for ios with no website, this is why I need to do this.

Can I serve blank pages to facebook crawler?

I have a site with thousand of pages crawled by facebookexternalhit bot.
Can I identify this bot, and serve just the <head> section with the og tags of my page?
Making this, I save some money with bandwidth and database access...
So my question is: What is the impact if I do it? Facebook needs to know what my site has inside the <body> tag?
Yes, provided there's a full set of meta tags served to Facebook's crawler there doesn't nee to be any other content: this is the similar to the 'pointers' functionality which is the recommended method for some edge-cases in Open Graph sharing:
https://developers.facebook.com/docs/opengraph/howtos/using-metadata-pointers
According to them:
Facebook allows its users to send links to interesting web content to
other Facebook users. Part of how this works on the Facebook system
involves the temporary display of certain images or details related to
the web content, such as the title of the web page or the embed tag of
a video. Our system retrieves this information only after a user
provides us with a link. You may have found this page because a
Facebook user sent a link from your website to other Facebook users.
If you have any questions or concerns about any links or content sent
by one of our users, please contact us at legal#facebook.com.
Basically if you do what you propose (and it'd be easy with a combination of RewriteCond and one extra QUERY_STRING param) you'll remove the possibility for Facebook to retrieve the meta info they need to build their nice post when an user insert a link in a chat, a private message, or a post.
I would rather try to understand if and when a certain page is hit multiple times in a short period since this shouldn't be the case.

Is liking an activity is the same thing as liking a business on facebook?

2 Part question
1) So I am trying to figure out the difference between "liking" something on pinterest vs "liking" a business. Is it the same thing?
2) I want to implement people "liking" different pages on my website (such as pinterest) and track which page has the most likes. Do I have to save and track that in my database or facebook API will let me see which pages has most likes based on some criteria?
TLDR: Yes, they are the same thing.
A Facebook "Like" is what is an Open Graph Action. Liking something from within the Facebook web interface or via one of the Facebook plugins allows an easy implementation path. Pinterest uses a custom script that initiates a built-in like action.
Both types of like require there to be an object with open graph metadata that Facebook can scrape to get the information that will be shared on a timeline. That metadata could be served by Facebook on an internal page, or by an external page.
As for getting the number of likes, yes you can. Each canonical open graph URL gets an id within the Facebook system. This includes objects within the Facebook system.
So, the Pinterest Facebook page has an id of 253591661347566. You can find this by querying https://graph.facebook.com/pinterest?fields=id
The Pinterest home page has an id of 185629821512802 according to https://graph.facebook.com/http://pinterest.com?fields=id. (Not urlencoded for clarity). You could replace http://pinterest.com with any other url, and get that pages id.
For any object that you know the id, you can get information on the number of likes it has by adding likes to the fields querystring.
If you've marked up your pages with an app id and admin information, you can see all of this and more through Facebook's Insights.

Facebook scraper. Can I reply with different content for it?

I'm developing an url shortener and the current specification requires to avoid Facebook from scraping those links and instead an integrated scraper will do that and hand over the og meta tags to Facebook.
Is there anything in Facebook terms that doesn't allow me to reply to its scraper with different content (e.g. an empty page with opengraph meta tags only) from what a regular user would see?
Thanks in advance.
I just did this on my site.
I am redirecing non-mobile devices to another page but want the facebook scraper to get the content a mobile device would get.
This is the User Agent I get:
facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
so matching against a regular pattern like this should detect the facebook scraper.
/^(facebookexternalhit.*)/
As mentioned above, this user agent can be spoofed easily which, in my case, doesn't matter.
Only problem could occur if facebook changes the user agent of their crawling script.

When should I use fb:admins and fb:appid?

I have a client who already has a Facebook page associated with their own website. I finally convinced them to integrate open graph tags into their pages, since when anyone clicked the Facebook Like button on their website, it looked awful on Facebook (since it chose whatever images and content it wanted).
I have admin access to their Facebook page, however, they are using the fb:appid tag instead of fb:admins on their website, so I can't see any of the insights on Facebook.
So I need to be made an admin of their Facebook application as well, in order to see the insights?
I've read dozens of forums and posts about this, including Facebook's own Open Graph documentation and I still don't REALLY understand the difference between fb:admins and fb:appid. As far as I can tell, fb:appid is more for developer/programming access, whereas fb:admins is for those who just want reports and insights for page activity.
In what circumstances would I want to use fb:appid over fb:admins?
EDIT : Let me clarify. I can already view insights for the company's Facebook page. What I want to do, is see the insights for users who have clicked the Like button on the website.
fb:app_id is the most flexible one to use.
It allows anyone who's listed in the app settings as an admin, developer or insights user to see their domain or app insights. This means as people join or leave a company, they update their app in one place, and access to things like insights changes too.
fb:admins is for User IDs, and once they've been associated with a URL or domain, they remain connected with that domain until their removed from the root HTML document.
fb:page_id works in the same way as fb:app_id in that access to insights is controlled by the list of people who are admins of that page.
As app_ids are becoming more and more important as you integrate with the deeper bits of the Facebook platform (use connect, comments etc) I STRONGLY suggest you use fb:app_id, claim your domain using this, and manage access to insights via your app's settings.