Website with restricted access to sites and promotions

I have a website with alcohol content that I have registered as a Facebook application. When I set application restrictions using the graph API (https://graph.facebook.com/APP_ID?restrictions= {"age_distribution": "21+"} or {"type": "alcohol"}), a link to Facebook application is hidden from juvenile accounts, which is great.

The problem is that when a person over this age loves or shares a page on a website, his minor friends can see this on the aforementioned person’s profile wall. Is there a way to hide the β€œhow” and β€œshare” messages on the user's wall in terms of juvenile accounts? I saw this with other websites, but could not reproduce it myself.

Here are the meta tags and javascript calls that I use on the website:

<meta property="og:title" content="FB Restrictions"/> <meta property="og:type" content="website"/> <meta property="og:site_name" content="FB Restrictions Site"/> <meta property="og:description" content="Testing Facebook Age Restrictions"/> <meta property="fb:app_id" content="MyAppID"/> <script> window.fbAsyncInit = function() { FB.init({appId: 'MyAppID', status: true, cookie: true,xfbml: true}); }; (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> 

Thanks in advance for your help!

+4
source share
1 answer

According to the Facebook User Restrictions Documentation, you can do this using the following Open Graph meta tags on the pages you are trying to limit:

Age limit

 <meta property="og:restrictions:age" content="21+"/> 

You can also set content-based restrictions on alcohol using:

 <meta property="og:restrictions:content" content="alcohol"/> 

In addition, you can also set restrictions on the country:

 <meta property="og:restrictions:country:allowed" content="US" /> <meta property="og:restrictions:country:disallowed" content="CN" /> 

* Please note that in the markup there can be only one instance :allowed or one :disallowed .

+1
source

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


All Articles