President Trump’s re-election campaign has spent far more than any single Democratic presidential candidate on Facebook advertising, reprising a strategy that was central to his 2016 victory.

Total Spending on Facebook Ads So Far This Year President Trump $1 million $2 $3 $4 2020 Democratic candidates Amount spent within the four weeks ending May 18 Elizabeth Warren Kamala Harris Joseph R. Biden Jr. Bernie Sanders Andrew Yang Amy Klobuchar Beto O'Rourke Kirsten Gillibrand Cory Booker Jay Inslee Julián Castro Marianne Williamson Pete Buttigieg Michael Bennet Tulsi Gabbard John Delaney John Hickenlooper Seth Moulton Tim Ryan Steve Bullock Eric Swalwell Wayne Messam Bill de Blasio President Trump $1 million $2 $3 $4 2020 Democratic candidates Amount spent within the four weeks ending May 18 Elizabeth Warren Kamala Harris Joseph R. Biden Jr. Bernie Sanders Andrew Yang Amy Klobuchar Beto O'Rourke Kirsten Gillibrand Cory Booker Jay Inslee Julián Castro Marianne Williamson Pete Buttigieg Michael Bennet Tulsi Gabbard John Delaney John Hickenlooper Seth Moulton Tim Ryan Steve Bullock Eric Swalwell Wayne Messam Bill de Blasio President Trump $1 million $2 $3 $4 2020 Democratic candidates Amount spent within the four weeks ending May 18 Elizabeth Warren Kamala Harris Joseph R. Biden Jr. Bernie Sanders Andrew Yang Amy Klobuchar Beto O'Rourke Kirsten Gillibrand Cory Booker Jay Inslee Julián Castro Marianne Williamson Pete Buttigieg Michael Bennet Tulsi Gabbard John Delaney John Hickenlooper Seth Moulton Tim Ryan Steve Bullock Eric Swalwell Wayne Messam Bill de Blasio Amount spent within the four weeks ending May 18 President Trump $1 million $2 $3 $4 2020 Democratic candidates Elizabeth Warren Kamala Harris Joseph R. Biden Jr. Bernie Sanders Andrew Yang Amy Klobuchar Beto O'Rourke Kirsten Gillibrand Cory Booker Jay Inslee Julián Castro Marianne Williamson Pete Buttigieg Michael Bennet Tulsi Gabbard John Delaney John Hickenlooper Seth Moulton Tim Ryan Steve Bullock Eric Swalwell Wayne Messam Bill de Blasio Notes: The spending figures are for Dec. 30 to May 18. The data comes from Facebook and includes ads on both Facebook and Instagram.

Mr. Trump spent particularly heavily on Facebook ads at the beginning of the year, when the number of Democratic candidates was smaller. But the playing field has shifted.

Since entering the race late last month, former Vice President Joseph R. Biden Jr. has pumped more than $1 million into Facebook ads, outspending Mr. Trump’s campaign for three of the past four weeks.

So far this year, Mr. Trump has spent about $5 million on Facebook advertising. Early in the year, Mr. Trump’s Facebook spending exceeded that of all of the Democratic candidates put together, though Democrats’ collective spending eventually surpassed Mr. Trump’s total.

Facebook Spending: Mr. Trump vs. the 2020 Democratic Field All Democratic candidates: $8.9 million $8 million 6 Mr. Trump: $4.8 million 4 2 January February March April May 23 Democratic candidates $9.6 million $8 million 6 Mr. Trump $4.9 million 4 2 Jan. 5 Feb. 2 Mar. 2 Mar. 30 May 4 23 Democratic candidates $9.6 million $8 million 6 4 Mr. Trump $4.9 million 2 Jan. 5 Feb. 2 Mar. 2 Mar. 30 May 4 Source: Facebook | Note: The chart shows cumulative spending from Dec. 30 to May 18.

“For a long time, Trump was running an intensive campaign that no one was paying attention to,” said Mike Schneider, a partner at Bully Pulpit Interactive, a Democratic political and brand communications firm that is tracking Facebook spending by the presidential candidates.

“And while Democrats have picked up their efforts, they’re fighting over the same group of supporters while he’s broadly expanding his base,” Mr. Schneider said.

Much of Mr. Trump’s spending on Facebook advertising in recent weeks has gone toward ads that have been seen by older Americans, particularly women 55 and older, according to an analysis by Bully Pulpit.

Estimated Facebook Ad Spending by the Trump Campaign Women, by age $50 thousand $100 $150 65+ 55-64 45-54 35-44 25-34 18-24 Men, by age 55-64 65+ 45-54 35-44 25-34 18-24 Women, by age $50 thousand $100 $150 65+ 55-64 45-54 35-44 25-34 18-24 Men, by age 65+ 55-64 45-54 35-44 25-34 18-24 Women, by age $50 thousand $100 $150 65+ 55-64 45-54 35-44 25-34 18-24 Men, by age 65+ 55-64 45-54 35-44 25-34 18-24 Source: Bully Pulpit Interactive (spending from March 24 to May 11)

Older voters are an important constituency for Mr. Trump, having favored him over Hillary Clinton in the 2016 election, according to exit polls. Mr. Trump also has reason to want to shore up his standing with women, as white women shifted leftward in the midterm elections.

Mr. Trump can pour millions into Facebook advertising because he has a big fund-raising head start over even the best-funded Democratic candidates. He ended the first quarter of the year with about $41 million in cash on hand, far more than the leading Democratic fund-raiser, Senator Bernie Sanders of Vermont.

The Trump campaign received widespread attention for its aggressive use of Facebook in the 2016 election.

In interviews after the 2016 victory, Brad Parscale, who was the campaign’s digital director, described how the Trump campaign sought to make the most of Facebook to reach prospective supporters. Facebook ads make it possible to reach places “that you would never go with TV ads,” Mr. Parscale said in a 2017 interview on “60 Minutes.”

To maximize the effectiveness of its advertising, the Trump campaign used tens of thousands of different ad variations on any given day, said Mr. Parscale, who is now managing Mr. Trump’s re-election bid.

“Changing language, words, colors, changing things because certain people like a green button better than a blue button,” he said. “Some people like the word ‘donate’ over ‘contribute.’”

Campaign officials say that their strategy will expand upon what they did in 2016, not only with Facebook but with other online platforms where voters are consuming news as well. The campaign has found that voters it wants to target are also spending a significant amount of time getting information on YouTube, according to an official.

The campaign anticipates spending hundreds of millions of dollars on its online strategy for the 2020 election, officials said.

Many of the Trump campaign’s ads on Facebook are designed to get users to provide their contact information and expand the size of the campaign’s already enormous list of supporters. Others solicit donations or peddle Trump merchandise.

“Facebook ads are a really valuable source for building your email list, and the more emails you have on your list, the more money you’re going to raise online,” said Eric Wilson, a Republican digital strategist. “There’s a direct through line to resources for the campaign.”

Recently, the Trump campaign has spent heavily on one subject in particular: the president’s birthday.

Mr. Trump turns 73 next month, and his campaign has run an assortment of ads asking people to sign a birthday card for him. The ads vary in their words and visuals. Some show a young man in a party hat being embraced by friends bearing gifts and balloons; others show a woman holding a birthday cake, candles ablaze. Still more just show Mr. Trump.

Curiously, many of the ads say, incorrectly, that he will be turning 72.

Videos in Mr. Trump’s ads on his birthday, “fake news” and immigration

Other Trump ads have asked people to sign a birthday card for the first lady, Melania Trump, whose birthday was last month.

Over five weeks, Mr. Trump spent an estimated $450,000 on birthday ads on Facebook, accounting for slightly more than half of his Facebook spending during that time, according to Bully Pulpit’s analysis.

The birthday ads serve a key purpose for the Trump campaign: collecting contact information for possible new supporters as well as existing ones. Asking people to sign a birthday card is a tried-and-true tactic, digital experts said.

“Digital list-building efforts like birthday cards are a great way to re-engage supporters, to refresh your email list and to grow a more personal relationship with your existing donor base,” said Michael Duncan, a Republican digital strategist who is a founding partner at Cavalry, a public affairs firm.

The birthday ads are just one attempt to gather contact information. Other Trump ads ask people to take an “Official Presidential Job Performance Survey” or a “Mainstream Media Accountability Survey” — and to provide their name, email address and ZIP code in the process.

“We try to harvest and bring people in to become direct contacts,” Mr. Parscale said on Fox News in January. “Cellphone numbers, email addresses, things that we can have direct contact.”

Mr. Parscale said he hoped to accumulate contact information for as many as 40, 50 or 60 million people by the 2020 election. “We might possibly have everybody that could vote for the president in a direct contact method by Election Day,” he said.

Some Trump ads on Facebook have invoked themes like immigration, socialism and the supposed “witch hunt” against Mr. Trump — all topics that the president has been fond of talking about and is likely to continue discussing as he seeks a second term. He has also run ads highlighting last year’s criminal justice overhaul, as well as Spanish-language ads about Venezuela.

“You can really see the start of their general election campaign strategy and platform when you look through these ads over the past number of months,” said Tara McGowan, a Democratic digital strategist who is the founder and chief executive of Acronym, a progressive digital organization that has also been tracking Facebook spending by the candidates.

The issue of immigration is at the core of Mr. Trump’s political identity, having been a central focus of his 2016 bid, and it has been a significant theme in his re-election campaign’s advertising as well.

Some ads ask people to vote on whether Mr. Trump should close the border. Others ask people to take an “Official Secure The Border Survey,” whose questions include, “Do you think Democrats care about your safety?” Still more ask people to sign a petition to end what Mr. Trump calls “chain migration,” or family-based immigration.

A video from an immigration-focused ad

Over a two-week stretch in late March and early April, roughly three-quarters of Mr. Trump’s spending on Facebook advertising was for immigration-related ads, according to the analysis from Bully Pulpit. The firm classified Mr. Trump’s ads based on keywords included in their text; the immigration ads included words like “wall” or “border.”