It has also been told to stop taking data from third-party apps and combining that with its own.
Facebook collects information from across the internet – including third-party sources as well as its own other apps – and attaches it to users' accounts, in an attempt to build a more accurate picture about them and sell ads. That practise has come under intense criticism, from privacy campaigners and users who argue that it amounts to Facebook following them around the internet without their consent or event knowledge.
The company has abused its market dominance to combine user data from a range of different sources, according to the German cartel office, the Bundeskartellamt. It said Facebook users have only been able to use the social network on the condition that it can collect user data "outside of the Facebook website in the internet or on smartphone apps and assign these data to the user's Facebook account."
Bundeskartellamt president Andreas Mundt said Thursday that the ruling means "Facebook will no longer be allowed to force its users to agree to the practically unrestricted collection and assigning of non-Facebook data to their Facebook user accounts."
The ruling will not go into effect immediately and Facebook has one month to appeal, it said. Facebook has said it plans to.
Facebook's data collection practises have repeatedly been criticised in recent months, as it has been accused of abusing the vast amounts of data it collects.
In particular, users have voice concern about plans to combine data from Facebook's other apps – particularly Instagram and WhatsApp – and use them to sell ads across its range of products.
Germany's justice minister Katarina Barley said that Facebook had reached far beyond its platform to collect user data, and that she welcomed the cartel office's call for curbs on its ability to mix those various sources of personal information about the people who use it.
"Users are often unaware of this flow of data and cannot prevent it if they want to use the services," Ms Barley told Reuters. "We need to be rigorous in tackling the abuse of power that comes with data."