Four decades after American Airlines invented the frequent flier, loyalty programs have started to spread beyond airlines and into urban travel. Last November, Uber launched Uber Rewards, using perks like vehicle upgrades to woo and keep fickle customers. Uber’s program design nudges riders to take individual instead of shared trips, sparking worries that whatever impact ride-hail has on urban congestion, Uber Rewards will make it worse.

Now, though, some public transportation agencies—which take cars off the road and may, in certain cities, be losing fares to ride-hail—are responding in kind. Capitalizing on the spread of smartphones and mobile ticketing systems, which make personalized rewards much easier to administer, transit officials around the country are preparing for your daily commute to score you complimentary drinks, gift certificates, even free rides.

One of the first transit agencies to use rewards to tweak customer behavior was Bay Area Rapid Transit, which serves San Francisco and its environs. In 2016 it launched a pilot program called BART Perks, offering small cash rewards to commuters who opted to travel at less congested, off-peak times. BART claimed it got around 10 percent of targeted riders to make the adjustment. It ran a second, similar experiment earlier this year, funded by a $500,000 federal grant, with results expected in August.

On the east side of the San Francisco Bay, Contra Costa Transportation Authority took the idea a step further by trying to entice commuters to switch their mode of transport entirely. In November it launched a pilot with a startup called Miles, whose smartphone app tracks a customer’s location and uses machine learning to determine how they’re moving. The program awards “miles” based on distance and the mode of transport. Walking one mile is good for 10 “miles.” Driving the same distance nets you just one, with biking, transit, and ride-hail falling in between. The miles can be redeemed on the app for rewards through its partners (from whom Miles earns commissions).

The agency gave Miles $50,000 to create “challenges” that offer select Contra Costa County residents a $5 gift card to retailers like Starbucks or Amazon if they adjust their commuting habits to drive less often. “If you’re using a bike twice per week and driving three days a week, we want you to bike more,” says Peter Engel, the agency’s director of programs. CCTA is currently reviewing data from the pilot. In the meantime, its Bay Area compatriot Caltrain and nearby Sacramento Regional Transit have announced their own projects with Miles, with the same goal of pushing commuters away from driving.

Portland, Oregon’s bike-share system has taken a different approach. Biketown has been working with a startup called Validated to offer credits---which can be used to cover overage fees or annual memberships---to users who make purchases at retailers like Portland Gear and Green Zebra Grocery. In May, Validated was acquired for an undisclosed sum by ReachNow, a company that builds mobile ticketing systems for transit agencies. Its North American CEO, Nat Parker, believes that Validated’s model could work for transit, especially as cities like Baltimore and New York adopt mobile ticketing. “Discovery of offers, redemption of points, and interaction with the customer are all much easier to facilitate through a mobile channel,” he says.

Transit officials nationwide are getting excited about loyalty programs’ potential. J. C. Vannatta leads marketing and communications at Portland’s TriMet, where his agency is exploring a new rewards system. “We see the value of what it could bring, not only keeping our own riders coming back but also attracting new ones.” In Philadelphia, Septa marketing chief Liz Bradford says her agency could capitalize on its new mobile ticketing system to offer riders rewards based on their physical location. “If you arrive at Haverford Septa station and we have a partner nearby, we could send a push notification offering $1 off a beer tonight.” Such partnerships could give cash-starved transit agencies a valuable new revenue source.