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.
Related
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.
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.
In my Google Analytics reports I get "facebook.com / referral" as the source. Is it possible to get the exact URL?
I don't think it's possible. as #yahelc pointed on a previous comment most traffic from facebook goes through a facebook controlled redirect on page facebook.com/l.php .So if you want to have campaigns on facebook you can use urls with campaign query parameters to keep track of it.
eg: link to
http://www.example.com/?utm_campaign=Facebook&utm_medium=social&utm_source=facebook.com
Now they will show up in GA as a separate campaign and you can tell how many visitors come from that specific link. You probably want to minify that link using bit.ly or goo.gl.
Create multiple campaigns on facebook and change the utm_campaign parameter as much as you want. You can also create different utm_content parameter to separate your marketing efforts on facebook. Keep the utm_medium and utm_source as static as on the example above.
This is how social marketing analytics measures marketing efforts on social networks. Anything that comes from facebook is not tagged you know comes from people posting links to your site other than you.
At the same time it really makes no sense to have the referral url at all. If you think about it most of the times it will be from private posts that you don't even have access to see, even if you had a url for it. That's just not the way facebook works. It doesn't have pages, it has streams and posts.
More about url tagging:
http://support.google.com/analytics/bin/answer.py?hl=en&answer=1033863
The answer is yes and no. You can drill down to referral path for facebook source in the report Traffic Sources -> Sources -> Refferals by simply pressing facebook.com at the Source coloumn, just like for all other visits from the referring site.
But that would be not much of a use, because for facebook you'll always see /l.php. And that's how facebook works, it doesn't allow visitors to visit the link immedeately, instead it redirects user to the page with url facebook.com/l.php?u=<link-to-your-site.com> with a redirect or maybe with some text like "if you're sure you want to leave", so technically, the referring page would be this /l.php that GA shows.
So if you need to track the efficency of your Facebook activities - use utm tags, like #Eduardo Cereto mentioned. Here's a very nice video tutorial on link tagging for GA: http://services.google.com/analytics/breeze/en/v5/campaigntracking_adwordsintegration-v23_ia5/ (starts from p. 17, you can skip all that goes before).
Hope it helps!
i just know this settings here:
http://www.sebastienpage.com/2009/05/06/google-analytics-trick-see-the-full-referring-url/
I have a site that is available in multiple languages (English and German for now). The landing page / automatically redirects the visitor to either /en or /de. There are social buttons on the page that however use the / url so that numbers (Facebook like count or Google +1 count) does not segment for different languages.
When sharing a link to the site on Facebook, buttons are configured to share the / page (which also counts as a like since the visitor shares the same url as the like button).
However, if somebody just shares the site url manually, Facebook posts the the English description on his wall, even if the visitor gets the German site.
I guess, Facebook caches OpenGraph information about a site. Is there a way to tell Facebook localized OpenGraph information so that visitors can post links to the site having automatic description in the correct language?
I realize these questions have been asked before on Stackoverflow, but now that FBML is being deprecated, it seems like the answer may have changed.
I have a website that utilizes the Facebook API, which in current terminology I believe makes it a Facebook Platform website. This is now a Facebook Canvas App, which are apps that appear on Facebook itself in iframes.
The Requests Dialog would seem perfect for this, if not for the fact that it's tailored for sending invites for Canvas Apps, and in my case, the Canvas App is simply a blank page assigned to me when I got a Facebook API key. I suppose I could just put a welcome screen and a link on that page for users to click-through, but it's one more click and that much more friction, and a generally hackish approach.
I've found references indicating there was once a way for users to utilize FBML to send an Application Invite, which is not the same as a Request Dialog, such that when a recipient click Accept, they were sent to a URL instead of a Facebook Canvas App. However, as I noted, FBML is in the process of being deprecated.
In light of this, how can a non-Canvas website allow users to send invites to their Facebook friends?
The requests dialog is currently the only supported way. As as alternative you can use the old Facebook REST API to call notifications.sendEmail, which will send the user an email either to their actual email account or their Facebook mail account. That page says that an equivalent graph API method will eventually come to replace this method.
I ended up using the Request Dialog, and hosting on my canvas page a redirect as per:
Redirect User to my Website on a Facebook Canvas Page
Gave the nod still to OffBySome's answer, though, because of his useful information that led me to settle on the Request Dialog.