Demographic Restrictions
From Facebook Developer Wiki
With the addition of the new admin.getRestrictionInfo and admin.setRestrictionInfo API calls and the fb:restricted-to FBML tag to Facebook Platform, you can start restricting the content of your applications based on a user's age and country of residence.
You can also tailor your content based on a type (whether it contains alcohol content), and let Facebook do the filtering for you, based on the user's age and location. You specify a type when you set restrictions, and you can return the restrictions with admin.getRestrictionInfo.
The new API calls let you restrict users at the application level. If the user doesn't match the age and location requirements, then the user cannot see the application at all. If the user's age is hidden for privacy reasons, Facebook still determines whether or not the application is visible to the user.
You'll find the new fb:restricted-to tag to be a powerful and dynamic way to tailor content within your application. Use the new tag as policies apply. This tag also replaces the functionality previously offered by the fb:18-plus and fb:21-plus tags. However, if the user's age is hidden for privacy reasons, Facebook cannot determine whether or not the content is visible to the user, and thus it cannot be displayed. In this case, your fb:else clause should contain content that any user who doesn't necessarily meet these restrictions could see.
There are four criteria you specify to configure your application:
- age
- location
- age distribution
- type
When specifying the age, you can use plus (+) and minus (-) to restrict content to that age or older/younger (like 21+ for 21 and older or 18- for younger than 19). You can also specify a range of ages, like 18-35 so anyone between the ages of 18 and 35 (inclusive) can see the content. You can also specify multiple age ranges (like 19-,30+ -- if you want to exclude people in their 20s, for example). Every specified age must be an integer.
When specifying the location, specify the country or countries (using a comma-separated list) from the ISO 3166 alpha 2 code list. This list is not necessarily the same as the IANA ccTLD (country code top level domain) list. For example, the ISO 3166 entry for England is .gb, while the IANA entry is .uk.
The age_distribution attribute is a way to quickly specify age and location restrictions for multiple areas in one array.
Specifying a type allows you to target users based on age and location for custom made categories like alcohol (currently the only type available). Before rendering your FBML, we run a check against the type on Facebook, and if the user meets the age and location requirements, we'll render the content.
You can determine the allowable content types for a user by querying for allowed_restrictions on the user FQL table.
Specifying a type is more flexible as it allows you to tailor content for multiple locations. Otherwise, if you restrict your content to one age range and one location, then those users are the only ones who can see that content.
Keep in mind that the content you provide to people must still conform to the Facebook Statement of Rights and Responsibilities and the Platform Principles and Policies (pay particular attention to section IV.4).
[edit] Testing Demographic Restrictions
Demographic restrictions settings never apply to any user listed as a developer of the application. Keep this in mind when you test these restrictions. You should set up test accounts with varying demographics to ensure the restrictions are applied correctly.
