Facebook may be under fire for how it handles the data on its more than two billion monthly active users, but the social media company has been trying to get its hands on financial information from the financial services firms for years, reported The Wall Street Journal.

According to the report, which cites people familiar with the matter and documents reviewed by the paper, as late as 2017 Facebook urged financial firms to let them use customer data that comes from its Messenger platform for advertising and other initiatives. Several financial firms that were concerned about privacy reached agreements with the company to limit how it can use information that comes through its servers. The talks between Facebook and the firms underscore how Facebook balances the use of data for targeted advertisements with concerns about user privacy.

“Like many online companies, we partner with financial institutions to improve people’s commerce experiences, like enabling better customer service, and people opt into these experiences,” Elisabeth Diana, a Facebook spokeswoman, told The Wall Street Journal. “We’ve emphasized to partners that keeping people’s information safe and secure is critical to these efforts. That has been and always will be our priority.”

The paper reported that Facebook's talks with financial firms have evolved over the years. Initially, the site claimed ownership of all the data, and eventually allowed the firms to restrict use of the information. Many deals were reached before Facebook's developer conference last year, when several firms rolled out services on Messenger.

The report noted that in talks with American Express back in 2016, Facebook said it wanted the spending data of individual cardholders who pass through the site, which would have given the social media giant more data for targeting ads. American Express wasn't on board with that, and instead agreed to provide Facebook with aggregated transaction data for ads.