Facebook is facing curbs on how it exploits its users' most personal information to create bespoke advertising.
The European Commission is planning to stop the social network ''eavesdropping'' on its users to gather information about their political opinions, sexuality, religious beliefs and even their whereabouts.
Using sophisticated software, the firm harvests information from people's activities on the website, whatever their individual privacy settings, and makes it available to advertisers.
However, following concerns over the privacy implications of the practice, a European Commission directive to be introduced in January will ban such targeted advertising unless users specifically allow it.
Even though most of the information it harvests is stored on computers in the US, if Facebook fails to comply with the new legislation it could face legal action or a massive fine.
The move threatens to damage Mark Zuckerberg's plans to float on the New York stock exchange next year, by undermining the way Facebook makes money.
It comes as an investigation by London's Sunday Telegraph highlights the extent to which Facebook can help companies focus ads based on user profiles.
The information analysed and stored by the company is not limited to users' personal details, and ''likes'' and ''dislikes'' that they input on their ''walls''. It also gathers details about their friends, family and educational background and detects subtle changes to their lifestyle, enabling it, for example, to target a bride-to-be with advertising for wedding photographers.
Other commercially valuable information, such as what music people are listening to via the site, is also available to advertisers.
Everything people share with their friends on Facebook is being tracked by the firm, retained, and can be used for commercial purposes.
It can even ''eavesdrop'' on messages by performing keyword searches on behalf of advertisers. In this way it can find out, for instance, details about people's political beliefs or their sexual preferences.
All Facebook's 800 million users, whether they realise it or not, agree to let the company use their personal information.
Facebook said on the weekend that advertisers only saw ''anonymous and aggregate information'' to allow them to target their campaigns and this meant they were not able to target named individual users.
So while advertisers cannot say they want their ads to go to specific individuals, they can spell out a detailed description of the sort of person they want to reach - such as age, location, family background - which means the campaigns will only target a limited group of people.
Sign up for Computerworld eNewsletters.