Facebook open graph url redirect issue - facebook

I am trying use open graph API to publish an action. URL that I provide as part of meta data property og:url can be accessed by authenticated users only. Facebook is trying to scrape the URL and is ending up with a sign_in page due to a 302 redirect.
Do I have to construct a page just for facebook scraping with meta tags in it? Isn't this url linked to the content published on facebook?

If you want your articles to be sharable or do any SEO, you shouldn't be using 302 redirects. Bots will only see the content from the destination of the redirect.
You want to have just one URL for each piece of content. If an unauthenticated user, the Facebook Scraper, or Googlebot visits that URL, you want it to see all your Meta tags and some teaser content.
If the user isn't authenticated, use a server-side scripting language to display a register/sign_in dialog instead of the premium content. If the user is authenticated, then you show them the full content.
This is better even from a UX perspective: Say I follow the link from Facebook and register. When I sign in, how are you going to get me back to the content I wanted to see in the first place?

Related

Facebook tab iframe sharing

i have a tab in a page, with an iframe to a site built up to be like a simple facebook app, where users can create simple profile pages with an image and some text.
Now, once the profile is created (which is a simple html page with its own URL), i need to be able to share it, using some sharing services (like addthis) or even the standard send button. The problem is that the original site has to be always hidden (users have to not be able to see the URL of the "site"), but the sharing system need an absolute URL to know... what to actually share.
Obiouvsly, working in an iframe, the url is always that of the facebook page (it doesn't change navigating the site's pages), so how can I do this?
Thanks.
The problem is that the original site has to be always hidden (users have to not be able to see the URL of the "site")
Why not?
Please don’t say “security concerns” right now, because you should know there is no such thing as “security by obscurity” …
If you just want to have Open Graph URLs, that can be liked and shared, but want the user clicking on one of those URLs end up being in your iframe tab on Facebook again – then do a redirect to your page tab for actual users.
Either do it via JavaScript (which the Facebook scraper does not care about); or with a server-side redirect for any client that is not the Facebook scraper (it’s identifiable by it’s user agent or originating IP address of the request).

Facebook Insights not working with domain that has an homepage redirect?

I have a domain that 301 redirects itself from http://www.domainname.com to http://www.domainname.com/subfolder/
The Facebook meta property tag is present on every page of the subfolder and it was recognized by Facebook when I added it in my Insights Dashboard. However, insights data are not showing for anything -- not the website, the like button or the comment box.
Any advice? Can it be related to the fact that the domain homepage redirects istself to a subfolder?
If Facebook's Debug Tool can't read the tags, you can't claim the domain. Check you're exempting the Facebook crawler from your redirect, or else it won't be able to access your meta tags.

Post an OpenGraph action for Like and Comment without using Like and Comments plugin

I am using GraphAPI to send comments and likes to a facebook photo from my site. The problem is I want to post the action to the user's wall, one which should be viewable from their friends' news feeds like "ChrisB liked a link" and "ChrisB commented on a link", where link is the photo's url on facebook. Of course I expect the photo thumb and name and description to appear on the post as well.
I have attempted to use custom OpenGraph actions and objects for these, but og:url won't accept facebook links now (which is odd because it still works for facebook pages). The error I'm getting from the linter is "Facebook urls cannot be crawled".
Is there any way to get the result that I want?
Instead of using a Facebook URL directly, try using bit.ly links or some way of automating the redirection from your site to Facebook. For example, I would use the apache module mod_rewrite to create a page on my website, but have it redirect to Facebook.
E.g. 'fake page' would be domain.com/{photo_id}.jpg, but have mod_rewrite redirect to http://www.facebook.com/photo.php?fbid={photo_id}

How to force facebookexternalhit to reaccess?

I'm playing with facebook links via posting them. On the frist time a access from a user agent containing "facebookexternalhit" will visit your site and look for some meta tags.
So far so good that works. But if I try to repost the link no furure calls happens. How can I trigger to let facebook read the page again?
Are there some API calls I can use to trigger an update?
in the documentation for the Like Button it says:
When does Facebook scrape my page?
Facebook needs to scrape your page to know how to display it around
the site.
Facebook scrapes your page every 24 hours to ensure the properties are
up to date. The page is also scraped when an admin for the Open Graph
page clicks the Like button and when the URL is entered into the
Facebook URL Linter. Facebook observes cache headers on your URLs - it
will look at "Expires" and "Cache-Control" in order of preference.
However, even if you specify a longer time, Facebook will scrape your
page every 24 hours.
The user agent of the scraper is: "facebookexternalhit/1.1
(+http://www.facebook.com/externalhit_uatext.php)"
The Linter is now known as the Facebook Debugger and when you use it for a url, it will clear the facebook cache for the same url and will then cache the new result.
One trick you can use is to simply append a "random" GET parameter to the URL that you're sharing. It won't have any effect on the page's content, but will cause Facebook's scraper bot to reaccess your site.
Original URLs:
http://example.com
http://example.com?param=1
New URLs that will force a "reaccess":
http://example.com?cache_buster=784932789532
http://example.com?param=1&cache_buster=784932789532

Link to fan-page with app_data parameter removes the app_data parameter

I have a FB app in an iframe on a Facebook fan-page. If I create a URL linking to that page, and that URL contains an app_data parameter, like this:
https://www.facebook.com/pages/My-Page/123?sk=app_456&app_data=mydata
Then post that in my FB feed, FB strips the app_data parameter, reverting to the canonical URL for the fan page:
https://www.facebook.com/pages/My-Page/123?sk=app_456
Which isn't what I want.
I would consider this a bug, as the state of the application is part of the "canonical" state of the fan page, but for now: Any way to get around this?
I have thought about making the bookmark to my own page:
https://facebook.mysite.com/pages/My-Page/123?sk=app_456&app_data=mydata
and dynamically generate a page with all the OpenGraph tags from the corresponding FB page (to make FB sharing work), and a redirect to the fan page (to get the user to the right place) - but this requires either (a) scraping FB for those OpenGraph tags or (b) accessing the graph.facebook.com api programmatically in a crawl-like fashion, and I don't know what FB thinks of that.
G'Day Leo, might be a bit of a hack but seems to work. I link my app_data onto a separately hosted URL and redirect back to Facebook with it.
So my URL I share is: https://externaldomain.com/deeplinker.aspx?data=stuff
Then response a redirect which is: https://www.facebook.com/[pageurl]?sk=[app]&app_data=[data]
With [data] = stuff