If any service best reflects the new economy, it may be hailing rides on demand from big companies like Uber and Lyft. They let riders avoid the hassle of flagging down a taxicab by simply tapping a mobile application on a smartphone. A driver arrives within minutes to take them to their destination.

But unlike old-economy taxicab companies, the new ride-hailing services often pay little to none of the license fees or taxes that taxi businesses hand over to cities, counties and states for the right to operate. If anything, their appearance on the scene reduces the taxes and fees that government counts on by taking customers away from the old-economy taxis.

That’s changing. Some states and localities are starting to tax the ride-hailing services. It’s not just an attempt to replace the revenue they’ve lost from the taxicab industry as a result of the new competition. Taxing the transportation network companies also is a sign of how governments are seeking to overhaul their tax structures in response to a rapidly changing economy that relies more on internet-based services than manufacturing and traditional bricks-and mortar retail shopping.

“When we see the economy evolving this quickly in front of our eyes, it can be a wake-up call to lawmakers that times are changing and a tax code written decades ago needs to change with it,” said Carl Davis, transportation analyst for the progressive Institute on Taxation and Economic Policy.

By simply imposing ordinary sales taxes on the ride-hailing industry, the institute estimates state and local governments could raise $300 million a year in revenue.

So far, barely more than a handful of states — including Maryland, Massachusetts, Nevada, Pennsylvania and South Carolina — have subjected ride-hailing services to existing sales taxes or imposed extra taxes or fees on them. Pennsylvania, for instance, assesses a 1.4 percent tax on all rides under a new law approved in November. New York’s budget, passed just last week, includes a 4 percent tax on the transportation network companies as part of an overall regulatory scheme.

Most of the new taxes and fees are included in new regulations, as states move to tame the upstart industry, set legal standards for drivers and protect passengers.

But establishing a new regulatory and tax framework isn’t always easy. An effort to do so failed in Georgia this year after a barrage of criticism from the ride-hailing services, which mounted a campaign to oppose any new taxes.

Part of the problem is that in most states, sales taxes do not apply to taxi rides, although many taxis pay “medallion” or “hack licenses” fees. The patchwork approach to taxing ride services or taxis is just one example of how state tax codes in many cases have not kept up with all the ways the economy has changed.

“Most states don’t tax taxi rides under their sales tax,” Davis said. “That’s largely a historical accident. The states exempted services in general — lawn care, pool cleaning — and taxi rides fall into that category, as well.”

State tax codes, just like the federal one, have not been overhauled in decades and no longer match the behavior of consumers, who increasingly are buying their goods online and turning to fuel-efficient hybrid or electric cars.

The change in behavior has upended two pillars of state and local tax codes: Taxing purchases at bricks-and-mortar stores, and taxing fuel at the pump. Because many internet sales elude sales taxes (despite Amazon’s agreement to start collecting the taxes), state and local treasuries are suffering. And because most highway and street repair is financed by taxes on the amount of fuel sold, states have less money to make those repairs.

The Pennsylvania Experience

When Democratic Gov. Tom Wolf signed legislation to regulate and tax ride services across Pennsylvania, he put to rest a yearslong battle over their operation in Philadelphia that illustrated the difficulty of devising a regulatory and taxation framework for the new-economy industry.

For several years, ride-hailing services operated in Philadelphia, with their legality in question. (The Pennsylvania Public Utility Commission charged Uber in 2014 with operating without a license. That dispute was settled only earlier this month for $3.5 million.)

Two years ago, the Legislature gave the services temporary authority to operate in the city. (That authority expired in January for Uber and in February for Lyft, putting the legality of the services in jeopardy without further legislation.)

But even with that permission, whether and how the services could operate was marred by controversy with the local regulating authority and court action brought by licensed cab drivers, who claimed unfair competition. The legality of the companies’ operations was an on-again, off-again matter of dispute.

When thousands of out-of-towners descended on Philadelphia in July for the Democratic National Convention, for instance, Wolf signed legislation to let the ride-hailing services operate without legal repercussion in the city for two and a half months.

The temporary action pointed up the usefulness of the transit-on-demand companies, and the pressing need to end the disputes and establish a permanent framework to govern them. Adding to the urgency was Uber’s investment of millions of dollars in an experimental facility in Pittsburgh to test self-driving cars — an experiment the city welcomed.

Under the new law, Philadelphia can now assess a 1.4 percent tax on the rides, two-thirds of which will go to help city schools, with the rest going to the city’s parking authority. Philadelphia International Airport also can assess a fee on rides originating there, to go to Delaware County, where the airport is located.

There is no similar assessment on the services in the state’s other counties, where state regulations — including background checks, insurance requirements and vehicle safety standards — now allow them to operate.

The ride-hailing services welcomed the regulation, as it got them out from under lawsuits and the Philadelphia moratorium. Lyft called the law a “win for drivers, passengers and communitiesb across Pennsylvania.”

Regulations for All of New York

New York City began adapting its regulations to cover ride-hailing services when they started operating in the city in 2011. But local regulations and insurance requirements have hampered expansion of the services to other cities in the state, such as Syracuse, Rochester and Buffalo. And that prompted upstate lawmakers to seek a statewide law.

Republican state Sen. James Seward, who represents a district near Syracuse, said the ride-hailing services needed standard insurance requirements across the state to make it easier to operate.

On Sunday, they got their wish as part of a budget bill that subjects all rides to a 4 percent state sales tax. Although the law allows big cities to opt out, none have so far expressed an interest in doing so. The regulations will take effect in about 90 days.

What does the state get? “By making this option available throughout New York state, there will be more options for safe, affordable, reliable transportation service,” Seward said.

New York also is expected to collect $24 million annually from the tax. Proceeds will pay for the state Department of Motor Vehicles to regulate the industry and provide money for infrastructure programs.

Resisting Taxes

The new industry doesn’t always welcome regulation and taxation. Take Georgia for instance.

The Georgia House this session passed a bill to apply the state’s 4 percent sales tax, plus any local sales taxes, to transportation services including ride-hailing.

But the bill foundered in the Senate when some lawmakers were worried about being tagged with a tax increase, egged on by the ride-hailing services, which mounted an anti-tax public relations campaign.

“Tell your Representative to vote NO on increasing the cost of your Uber ride,” the company wrote in a blog post. “If protecting your hard-earned money is important to you, this is your chance to speak out against this tax hike.”

Republican Rep. Jay Powell, chairman of the House Committee on Ways and Means and sponsor of the bill, said taxing the services was a matter of fairness because taxi and limousine services already pay the taxes. “We did not see any difference between them and Uber and Lyft,” he said. But anti-tax politics won out.

New state regulations and taxes can have a real downside for the new-economy services.

In January, for example, Massachusetts began enforcing new standards for ride-hailing drivers. Since then, more than 8,000 drivers were suspended from driving because they failed background checks. The drivers’ infractions ranged from suspended driver’s licenses to sexual offenses.

(Maryland has booted more than 4,000 of the state’s ride-hailing drivers off the road since December 2015 because they failed to meet the state’s screening requirements.)

The Massachusetts law imposes a 20-cent-per-ride fee on the app-based ride services, with 5 cents of that going to upgrade ordinary taxis, 10 cents going to local governments and 5 cents going to a state transportation fund.

The fees can add up, as Lyft and Uber alone have a combined 2.5 million rides a month in the state. And they show how important it is for states to keep pace with the evolving economy.

This story was produced by Stateline, an initiative of The Pew Charitable Trusts. You can view the original report on its website.