Mr. Castro, Ms. Gabbard, Ms. Gillibrand and Mr. Steyer are all within striking distance. Mr. Castro and Mr. Steyer need only one more qualifying poll; Ms. Gabbard needs three more; and Ms. Gillibrand needs about 30,000 more donors as well as three more qualifying polls.

None of the other candidates except former Gov. John Hickenlooper of Colorado have hit 2 percent in any qualifying polls, and Mr. Hickenlooper had only about 14,000 individual donors as of June 30. The Times reported this week that he was considering dropping out of the race.

[These three cities are key for 2020 Democrats. They’re not in Iowa or New Hampshire.]

The campaigns are not necessarily seeing a return on their investment as they hunt for new donors; many are asking for $1 contributions. But the size of the donations does not matter for debate qualification, only the number of individual contributors. That has skewed campaigns’ strategies and encouraged them to create advertising they hope will go viral.

Mr. Castro’s new advertisement is set to appear Wednesday on Fox News in Bedminster, where Mr. Trump is staying at his golf course. In the ad, Mr. Castro speaks directly to the president, ticking off Mr. Trump’s words and actions that he says “stoked the fire of racists" and inspired the mass shooting that killed 22 people in El Paso this month.

“Innocent people were shot down because they look different from you. Because they look like me. They look like my family,” Mr. Castro says in the ad. “Words have consequences.”