BERLIN — Facebook is pushing back against a German ruling that could make it harder for the company to combine data from all the services it runs in order to target ads even more precisely.

Thursday’s ruling, though aimed at current practices, hints at potential troubles ahead if Facebook follows through with plans to integrate the messaging functions of WhatsApp, Instagram and Messenger as early as next year.

German antitrust authorities ruled Thursday that Facebook was exploiting its dominance in social media in forcing users to also allow the company to collect data from other Facebook-owned services such as WhatsApp and Instagram, as well as third-party websites through the “Like” and “Share” buttons.

The Federal Cartel Office, or Bundeskartellamt, isn’t contesting Facebook’s use of customer data to target ads on the main Facebook service. Rather, the ruling said Facebook should have to get consent separately before using customer data from other apps and websites to do so.

Facebook said it would appeal.

The company currently collects data on users’ activities on Facebook and the other apps it owns, along with third-party websites. So, what someone views, likes or shares on Instagram — or the broader web — could be used to show that person an ad on Facebook.

Facebook also has been moving to further integrate WhatsApp and Instagram into its main service after initially promising to keep both as stand-alone companies when it bought them.

Although Facebook hasn’t given many details on its plans to integrate messaging, CEO Mark Zuckerberg said that the idea is to help users message one another more easily, without having to worry about who’s on which service. The company also said it would encrypt all the messaging services, something it does by default only with WhatsApp.

But critics have raised another possible reason — the threat of antitrust crackdowns. Essentially, if Facebook combines its messaging services so that they are different in name and design only, it will be much more difficult, if not impossible, to then separate out and spin off Instagram and WhatsApp as separate companies.

Combining the three services also lets Facebook build more complete data profiles on all of its users. Already, businesses can already target Facebook and Instagram users together with the same ad campaign, and ads are likely coming to WhatsApp eventually.

Then there’s competition from other messaging services, such as Apple’s or Google’s. Users are more likely to stay within Facebook’s properties if they can easily message their friends across different services, rather than having to switch between Messenger, WhatsApp and Instagram.

Privacy attorney Scott Vernick expects the integration plans to draw regulatory scrutiny, particularly in Europe. That’s because of Facebook’s promises that it would keep the companies separate when it bought Instagram in 2012 and WhatsApp in 2014. WhatsApp’s founders quit the company over disagreements about user privacy.

“There is a high chance for antitrust concerns, as well as those over how user data is collected and used,” Vernick said.

There are also worries that Facebook could build deeper profiles, such as by linking phone numbers to real-life identities, he added. Facebook doesn’t require users to add their phone number, but WhatsApp is generally used with phone numbers. Between the two, Facebook gets more data.