The beverage industry spent a lot of money to defeat soda taxes in four U.S. cities Tuesday, but it lost in every one of them.

The victories for soda-tax advocates — in San Francisco, Oakland and Albany, California, and Boulder, Colorado — were decisive. Those communities now join Berkeley, California, and Philadelphia in embracing plans to tax sugary beverages.

The pro-tax forces had the help of their own deep pockets. The billionaires Michael Bloomberg and John and Laura Arnold donated heavily to the pro-tax campaigns. They did not match industry spending, but got close. Altogether, the Bay Area campaigns cost about $50 million, more than was spent on the state’s Senate race, medical marijuana initiative and gun control measures combined.

The spending may have made a difference. Big donors stayed out of early soda-tax fights, but the beverage industry always fought hard against them, and 40 such measures failed. Bloomberg, the former New York mayor, donated in the late days of the Berkeley campaign, and he has spent more heavily in the more recent fights.

Howard Wolfson, one of Bloomberg’s senior advisers, said the victories would encourage Bloomberg to invest in soda tax initiatives in more cities. He has already put $1 million into television commercials in Cook County, Illinois, where county officials will vote on a soda tax Thursday to help fund spending on public safety.

“The tide has clearly turned on this issue, and momentum has swung in our favor,” Wolfson said. “I am confident in the months ahead more municipalities will seek to implement soda taxes to help their citizens, and we will be willing to help them as they do.”

Soda taxes, originally dreamed up in academic journals, were once dismissed as a fringe idea, possible only in a place as liberal as Berkeley. They are now the law in major American cities.

The measures have been advanced by economists and public health experts looking for methods that might combat obesity, diabetes and tooth decay — maladies all linked to soft drink consumption.

But soda taxes are new enough that the evidence that they have much effect on health is still unclear. Early research from Berkeley and Mexico, which passed a national tax in 2014, suggests that such taxes can increase prices and reduce purchases of sugary drinks. Measuring their health effects will take longer.

In the Bay Area communities, advocates used health arguments to sell the measures, focusing on childhood obesity as a particular public health risk. But that has not been the strategy everywhere.

In Philadelphia, Mayor Jim Kenney sold the tax as a way to fund popular prekindergarten expansion. In Cook County, the tax is being described as a way to pay for police in the Chicago area. Future initiatives are likely to be tied to local political preferences and needs.

The American Beverage Association, an industry group, has vowed to fight soda taxes wherever they appear. The group’s president, Susan Neely, has described the communities that voted this week as unusually liberal and health-conscious. Wins there, the group argues, are not predictive of sentiment in the rest of the country. She said the industry shared health advocates’ goals of reducing obesity, but not the means.

But public sentiment on sodas may already be shifting. Though the public remains divided on taxes, often seen as a nanny-state intrusion, more and more Americans are turning away from the beverages. Sales are down, and many people say they are actively avoiding the products. Anti-soft drink advertising is likely to appear in major American cities. The declining public image of the beverages will create new challenges for the industry, even if it does not keep losing soda tax fights.