Sen. Kamala Harris is spending more money on Facebook ads than any other U.S. Senator or potential Democratic presidential candidate, helping her grow a digital presence that would be a powerful asset if she decides to run for the White House.

Over a two-month snapshot from early May through early July, Harris’ ads on Facebook have been viewed at least 7.8 million times, and her campaign has spent at least $134,500 on the platform, according to data from a recent New York University study provided to the Bay Area News Group. That’s a larger sum than any U.S. politician other than President Trump and Texas Congressman Beto O’Rourke, who’s running for Senate.

The largess has helped massively expand Harris’ donor base, transforming her from a more traditional Hillary Clinton-like politician raising large chunks of money to a more Bernie Sanders-type figure bringing in a wave of small-dollar donations — even though she isn’t facing re-election in the Senate for four years. It’s an early indication that she’s courting a national audience in the runup to 2020 as a crowded field of Democrats takes shape.

“For Kamala and anyone thinking about running for president, the early primary race is all about perception,” said Rose Kapolczynski, a political strategist in Los Angeles who doesn’t work for Harris. “Before a single vote is cast in the presidential primaries, you need to have other metrics to show that you are building momentum” — including social media.

In a sign that Harris isn’t only targeting Golden State voters, 76 percent of her ad views over the last two months came from outside California. And 70 percent of those views were from women, the NYU data shows.

Facebook has rapidly become a cornerstone tool for savvy campaigns of all political stripes. Political ads show up in users’ news feed. People who click them are taken to a landing page that invites them to donate — and, more importantly, sign up for a candidate’s email list. Once a potential supporter is on a candidate’s list, the campaign can send them messages asking for more small donations again and again.

Each Facebook ad can be individually targeted by gender, age and location. In the hours after Trump nominated Judge Brett Kavanaugh for the Supreme Court earlier this month, for example, Harris’ team bought dozens of nearly identical Facebook ads declaring her opposition, targeted to appear in the news feeds of different groups of people, according to a database published by the social media company.

“I don’t know if this is the future of political fundraising, but it is the present,” said Sean Clegg, one of her political advisers. Widespread anger at the Trump administration among liberals “has created an awareness and intensity on the left that is profound,” he said. “People want to do something about it.”

Harris’ Facebook reach and email list are crucial tools as she tests the waters for a potential presidential run in 2020. She’s topped other possible contenders for the Oval Office in Facebook ad spending since early May, including Sen. Kirsten Gillibrand (D-NY), whose Facebook ads had at least 5.4 million views, Sen. Elizabeth Warren (D-Ma.), whose ads had at least 2.3 million views, and Sanders (I-Vt.), who had 2.2 million views. New York Gov. Andrew Cuomo’s ads on the platform were viewed more than Harris’ — at least 9.7 million times — but his campaign spent less, at least $47,900.

Warren and Sanders, who’ve been in the national political spotlight longer than Harris, still have racked up more Facebook likes and followers than her.

“Any presidential candidate who is looking at 2020 should be starting early building their digital apparatus,” said Mac Zilber, a Democratic strategist in Los Angeles who doesn’t work for Harris.

Trump has dominated American politics in use of Facebook ads, spending at least $274,000 between his campaign and PAC and reaching more than 37 million people, according to the study.

Candidates have been buying ads on Facebook for years, but the social media giant only recently made data about political ads publicly available, responding to reports of Russian groups using the platform to manipulate American voters. The NYU study, which was published this week, analyzed data scraped from Facebook’s public database of political ads. In total, researchers found, campaigns, political committees and other groups spent at least $13.9 million in two months, and their ads were viewed at least 1.4 billion times.

“This strategy is definitely unproven,” said Laura Edelson, one of the NYU Tandon School of Engineering researchers, in an interview. “It’s like any new medium, people are still figuring out how to use it and most effectively engage with people.”

Edelson and her co-authors acknowledge that their database isn’t necessarily comprehensive or exact, in part because Facebook reports ad views and spending in ranges. The numbers they found for Harris and other candidates are conservative minimums.

Harris’ advisers say they didn’t use Facebook ads as often during her 2016 race for Senate. On election night, the Senator-elect gave a to-the-barricades speech denouncing Trump, and her campaign decided to use some leftover funds in their digital budget for Facebook ads highlighting her message. They saw those ads catch fire, inspiring a new focus on the platform.

Harris has been bringing in between $440,000 and $930,000 every three months since taking office, according to Federal Election Commission data. She’s also spent more than $1.8 million for digital consulting, Facebook ads and other web advertising, including at the political firm that did fundraising for Sanders’ 2016 campaign.

Federal fundraising reports show how Harris’ donation profile has changed. During her 2016 campaign for Senate, only 13.6 percent of her total haul came from unitemized donations less than $200. But since the beginning of 2017, 75 percent of her donations have been from those small dollar contributions — something her advisers attribute in part to Facebook ads. Her average donation since winning office has been about $22, her staff says, down from $178 during her Senate race.

“We’ve been able to build a digital fundraising capacity that allows her to spend less time fundraising in hotel ballrooms and more time doing her job as senator,” Clegg said.

While Harris has said she’s focused on helping Democrats during the 2018 midterms — in part by raising $5 million for her colleagues around the country — she isn’t ruling out a 2020 presidential run.

After Harris, the California campaign with the next most viewed Facebook ads in the two-month window was a pro-charter school PAC supporting schools superintendent candidate Marshall Tuck, which had its ads viewed at least 3.9 million times. Democratic governor frontrunner Gavin Newsom didn’t crack the list of the top 450 national candidates and groups by ad views, while his GOP rival John Cox did, spending at least $8,100 on the platform for ads that reached at least 560,000 people. The NYU data from May 7 to July 4 covered the run-up to and the aftermath of the Golden State’s primary election.

Facebook applauded the study.

“This report is exactly how we hoped the tool would be used – outside experts helping to analyze these ads on Facebook,” said Rob Leathern, the company’s director of product management. “It brings more transparency to the messages people see and increases accountability and responsibility over time, not just for us but advertisers as well.”

The social media giant will only be a bigger factor in elections later this year and in 2020, political strategists predict, as campaigns strive to connect with the more than two-thirds of American adults who use Facebook.

“A larger and larger percent of the population is becoming tougher to reach through traditional methods,” like mailing fliers or calling landlines, Zilber said. “As political operatives, you have to follow where the eyeballs are.”