Reputation: 25
I'm creating a "private" sale site for a client. To view the site contents, users have to register and login. We'd still like to use Facebook for sharing individual products. Unfortunately, if I have specific details for a product, when I share the link, all I get is the default open graph tags.
What are my options? This is occurring whether I am sharing a product from within the site or posting it via Facebook. I'm using the OpenGraph tags (as opposed to the linter), which I was hoping would solve this issue.
Thanks in advance for your help!
Upvotes: 1
Views: 806
Reputation: 11
You could also create a dedicated script to serving the share information. This technique is discussed here.
Upvotes: 1
Reputation: 64700
What you'll probably have to do is modify your pages so they render a dedicated view for Facebook's crawlers, with the OpenGraph tags set and all identifying information stripped out. You could look for their crawler's user agent (which I believe is facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
) and then based on that show the dedicated view.
Note that this will mean that anyone who crawls your site with that header set will be able to see the same content that you show the Facebook crawler, but given that its going on Facebook you probably don't care. Also not sure what the policy from Facebook is on that kind of switch: might be construed as faking content.
Upvotes: 2