Separation of problems with the "private" website on facebook

I have a website that you can only access after logging in.

I want to be able to post some products on it, but when I click the "Share" button, instead of using this particular element, it shares the content for the main site.

Example:

Main site: www.xyz.com Main site name: xyz.com Description of the main site: xyz site

Product website: www.xyz.com/product_b.php Product page name: Product B Product page description: Check out this amazing product.

When I click the "Share" button on the product page, instead of sharing product information, it shares the basic information about the site ... I think this is because it is a private site ...

I use addthis.com buttons for this, but it is the same when I try to do it directly on facebook ...

any ideas on how to solve this problem?

Thanks Louis

+4
source share
1 answer

If an unauthorized user is redirected to the "main site", then it is obvious that Facebook (when trying to get information about the shared page) will be redirected to the same page!

From the documentation:

Scraper user agent: "Facebookexternalhit / 1.1 (+ http://www.facebook.com/externalhit_uatext.php)"

So you can grab this and allow access to the Facebook scraper, but I really don't think you should do this (ethically). Instead, make a public page for each product showing minimal data and encourage users to register to view the full product page!

Just a side note (reminder), always use the Open Graph meta tags .

+3
source

Source: https://habr.com/ru/post/1344500/


All Articles