Open Graph URL is a permalink that redirects to page - facebook

I'm adding on my website the open graph meta tags and testing if it is working with the Facebook URL Linter.
The only thing that is not working how I would like it is the og:url: tag, in this meta tag I want to add the permalink url of the current page.
The permalink actually redirects to the current page. I use this because my URL of the pages looks like this : http://website.com/photos/243/hello-this-is-the-title/ and the last part of the URL can be changed be the user and if it is changed the URL will change and it will not be associated with all the "Likes" stored at Facebook.
This is why I have a permalink page that looks like this : http://website.com/permalink/243/ and this will redirect to http://website.com/photos/243/hello-this-is-the-title/, so that all the likes on Facebook are associated with the permalink instead of the other one.
When I use the Facebook URL linter it tells me that there are some critical errors that need to be fixed - Circular redirect path detected (see 'Redirect Path' section for details).
I don't know if what I want to do is possible. But I could really use a little help here.

This is why I have a permalink page that looks like this : http://website.com/permalink/243/ and this will redirect to http://website.com/photos/243/hello-this-is-the-title/, so that all the likes on Facebook are associated with the permalink instead of the other one.
When I use the Facebook URL linter it tells me that there are some critical errors that need to be fixed - Circular redirect path detected (see 'Redirect Path' section for details).
Two options:
Exclude the Facebook scraper from being redirected, by looking for it’s user agent (details).
Don’t redirect server-side, but do it client-side via JavaScript instead. (The scraper does not care about JavaScript.)

Related

Facebook debugger reports "Circular redirect path detected" (301) on certain website

Why isn't the Facebook debugger able to parse http://www.brandenburg-business-guide.de/ ? It reports 301 Circular redirect path detected. However, there is actually no redirection in place. Also apache's access.log reports no retrievals by facebook.
See https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.brandenburg-business-guide.de%2F and hit Debug button.
The page does not contain any OpenGraph meta tags. Check out the documentation.
Facebook scraper expects the page to contain og:url meta tag which will serve as the canonical url OR link tag with rel="canonical". Since the document is missing both, Facebook cannot decide what is the canonical url, hence the circular redirect path error.
For a reference, try Goodreads debugging information.
Hope this helps.

Open Graph scraping base URL instead the URL it's given

The Facebook OpenGraph debug tool is scraping the wrong page.
If I give it a full URL (pointing to an individual page on my site) that I want it to scrape, instead of scraping that page and finding its meta tags, it scrapes my site's main page and returns those meta tags (which are obviously wrong in this context).
The weird thing is, it will even find and scrape my site's main page even if it's not located at the root of my domain. For example:
I want it to scrape http://mydomain.com/myhomepage/specific_page.html
Instead, it scrapes http://mydomain.com/myhomepage/
This implies to me that the error must be a setting someplace, either on my site or on my Facebook App settings. Would the App settings do that? Redirect to whatever URL is set if a requested URL is a descendent of it?
The URL I'm requesting is not doing a 302 or anything - I can click the link from the FB debug tool even and it will take me to the appropriate page.
A few notes:
specific_page.html is not an actual file, it is routed through index.php using mod_rewrite in Apache's htaccess. I tried being specific with http://mydomain.com/myhomepage/index.php/specific_page.html and it did not work then either.
Another SO question led me to believe that the user-agent might be getting redirected if it doesn't allow cookies (as the Facebook web crawler does not) so I opened a fresh browser, disabled cookies, tried again, and I still reached the appropriate page.
As mentioned in the comments above, in your case this was due to an og:url meta tag, redirecting Facebook's crawler to that URL
In general, cases like this are usually the og:url tag, a HTTP redirect, or a canonical meta tag pointing at the 'other' / 'wrong' URL - Facebook's crawler follows those redirects looking for the final URL

Like Box ('Could not retrieve the specified page. Please verify correct href was passed in.')

I need some information, why like box frame not working: 'Could not retrieve the specified page. Please verify correct href was passed in.'. I`m testing this href in http://developers.facebook.com/tools/debug - it says correct answer, but frame not working.
In access logs for UA facebookexternalhit/1.1 always answer status 200 (and 301/302 for specific page).
example page: http://www.now.ru/item/series/comedy/Univer_222394
additional information: on some pages frame works, and some does not work
thanks.
The Facebook Like Box is really designed to use the URL for a Facebook page, not for a general Web Page. It pulls Timeline content from a fan page within Facebook.
It can be used for a Web Page if the page has defined Open Graph Meta Tags and has been Liked at least once. However, there will be no "stream" functionality. The Like-Box for a Web Page would just have functionality similar to the Facepile plugin (except that Facepile just shows you friends, and a Like-Box also shows non-friends.)
Typically, though, you would want to supply the Like-Box with a Facebook Page URL in the following format:
http://www.facebook.com/pages/Facebook-Page-Name/Facebook-Page-ID
Perhaps you are intending to use a Like Button or Facepile Social Plugin instead? Either of those can accept any URL as input.

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