In May 2016, after months of failing to find a traditional job, I began driving for the ride-hailing company Lyft. I was enticed by an online advertisement that promised new drivers in the Los Angeles area a $500 “sign-up bonus” after completing their first 75 rides. The calculation was simple: I had a car and I needed the money. So, I clicked the link, filled out the application, and, when prompted, drove to the nearest Pep Boys for a vehicle inspection. I received my flamingo-pink Lyft emblems almost immediately and, within a few days, I was on the road.

Initially, I told myself that this sort of gig work was preferable to the nine-to-five grind. It would be temporary, I thought. Plus, I needed to enrol in a statistics class and finish my graduate school applications – tasks that felt impossible while working in a full-time desk job with an hour-long commute. But within months of taking on this readily available, yet strangely precarious form of work, I was weirdly drawn in.

Lyft, which launched in 2012 as Zimride before changing its name a year later, is a car service similar to Uber, which operates in about 300 US cities and expanded to Canada (though so far just in one province, Ontario) last year. Every week, it sends its drivers a personalised “Weekly Feedback Summary”. This includes passenger comments from the previous week’s rides and a freshly calculated driver rating. It also contains a bar graph showing how a driver’s current rating “stacks up” against previous weeks, and tells them whether they have been “flagged” for cleanliness, friendliness, navigation or safety.

At first, I looked forward to my summaries; for the most part, they were a welcome boost to my self-esteem. My rating consistently fluctuated between 4.89 stars and 4.96 stars, and the comments said things like: “Good driver, positive attitude” and “Thanks for getting me to the airport on time!!” There was the occasional critique, such as “She weird”, or just “Attitude”, but overall, the comments served as a kind of positive reinforcement mechanism. I felt good knowing that I was helping people and that people liked me.

But one week, after completing what felt like a million rides, I opened my feedback summary to discover that my rating had plummeted from a 4.91 (“Awesome”) to a 4.79 (“OK”), without comment. Stunned, I combed through my ride history trying to recall any unusual interactions or disgruntled passengers. Nothing. What happened? What did I do? I felt sick to my stomach.

Because driver ratings are calculated using your last 100 passenger reviews, one logical solution is to crowd out the old, bad ratings with new, presumably better ratings as fast as humanly possible. And that is exactly what I did.

For the next several weeks, I deliberately avoided opening my feedback summaries. I stocked my vehicle with water bottles, breakfast bars and miscellaneous mini candies to inspire riders to smash that fifth star. I developed a borderline-obsessive vacuuming habit and upped my car-wash game from twice a week to every other day. I experimented with different air-fresheners and radio stations. I drove and I drove and I drove.

The language of choice, freedom, and autonomy saturate discussions of ride hailing. “On-demand companies are pointing the way to a more promising future, where people have more freedom to choose when and where they work,” Travis Kalanick, the founder and former CEO of Uber, wrote in October 2015. “Put simply,” he continued, “the future of work is about independence and flexibility.”

In a certain sense, Kalanick is right. Unlike employees in a spatially fixed worksite (the factory, the office, the distribution centre), rideshare drivers are technically free to choose when they work, where they work and for how long. They are liberated from the constraining rhythms of conventional employment or shift work. But that apparent freedom poses a unique challenge to the platforms’ need to provide reliable, “on demand” service to their riders – and so a driver’s freedom has to be aggressively, if subtly, managed. One of the main ways these companies have sought to do this is through the use of gamification.

A driver working for Lyft and Uber in Los Angeles. Photograph: Richard Vogel/AP

Simply defined, gamification is the use of game elements – point-scoring, levels, competition with others, measurable evidence of accomplishment, ratings and rules of play – in non-game contexts. Games deliver an instantaneous, visceral experience of success and reward, and they are increasingly used in the workplace to promote emotional engagement with the work process, to increase workers’ psychological investment in completing otherwise uninspiring tasks, and to influence, or “nudge”, workers’ behaviour. This is what my weekly feedback summary, my starred ratings and other gamified features of the Lyft app did.

There is a growing body of evidence to suggest that gamifying business operations has real, quantifiable effects. Target, the US-based retail giant, reports that gamifying its in-store checkout process has resulted in lower customer wait times and shorter lines. During checkout, a cashier’s screen flashes green if items are scanned at an “optimum rate”. If the cashier goes too slowly, the screen flashes red. Scores are logged and cashiers are expected to maintain an 88% green rating. In online communities for Target employees, cashiers compare scores, share techniques, and bemoan the game’s most challenging obstacles.

But colour-coding checkout screens is a pretty rudimental kind of gamification. In the world of ride-hailing work, where almost the entirety of one’s activity is prompted and guided by screen – and where everything can be measured, logged and analysed – there are few limitations on what can be gamified.

In 1974, Michael Burawoy, a doctoral student in sociology at the University of Chicago and a self-described Marxist, began working as a miscellaneous machine operator in the engine division of Allied Corporation, a large manufacturer of agricultural equipment. He was attempting to answer the following question: why do workers work as hard as they do?

In Marx’s time, the answer to this question was simple: coercion. Workers had no protections and could be fired at will for failing to fulfil their quotas. One’s ability to obtain a subsistence wage was directly tied to the amount of effort one applied to the work process. However, in the early 20th century, with the emergence of labour protections, the elimination of the piece-rate pay system, the rise of strong industrial unions and a more robust social safety net, the coercive power of employers waned.

Yet workers continued to work hard, Burawoy observed. They co-operated with speed-ups and exceeded production targets. They took on extra tasks and sought out productive ways to use their downtime. They worked overtime and off the clock. They kissed ass. After 10 months at Allied, Burawoy concluded that workers were willingly and even enthusiastically consenting to their own exploitation. What could explain this? One answer, Burawoy suggested, was “the game”.

For Burawoy, the game described the way in which workers manipulated the production process in order to reap various material and immaterial rewards. When workers were successful at this manipulation, they were said to be “making out”. Like the levels of a video game, operators needed to overcome a series of consecutive challenges in order to make out and beat the game.

At the beginning of every shift, operators encountered their first challenge: securing the most lucrative assignment from the “scheduling man”, the person responsible for doling out workers’ daily tasks. Their next challenge was a trip to “the crib” to find the blueprint and tooling needed to perform the operation. If the crib attendant was slow to dispense the necessary blueprints, tools and fixtures, operators could lose a considerable amount of time that would otherwise go towards making or beating their quota. (Burawoy won the cooperation of the crib attendant by gifting him a Christmas ham.) After facing off against the truckers, who were responsible for bringing stock to the machine, and the inspectors, who were responsible for enforcing the specifications of the blueprint, the operator was finally left alone with his machine to battle it out against the clock.

A Lyft promotion using a Back to the Future-style DeLorean car in New York in 2015. Photograph: Lucas Jackson/Reuters

According to Burawoy, production at Allied was deliberately organised by management to encourage workers to play the game. When work took the form of a game, Burawoy observed, something interesting happened: workers’ primary source of conflict was no longer with the boss. Instead, tensions were dispersed between workers (the scheduling man, the truckers, the inspectors), between operators and their machines, and between operators and their own physical limitations (their stamina, precision of movement, focus).

The battle to beat the quota also transformed a monotonous, soul-crushing job into an exciting outlet for workers to exercise their creativity, speed and skill. Workers attached notions of status and prestige to their output, and the game presented them with a series of choices throughout the day, affording them a sense of relative autonomy and control. It tapped into a worker’s desire for self-determination and self-expression. Then, it directed that desire towards the production of profit for their employer.

Every Sunday morning, I receive an algorithmically generated “challenge” from Lyft that goes something like this: “Complete 34 rides between the hours of 5am on Monday and 5am on Sunday to receive a $63 bonus.” I scroll down, concerned about the declining value of my bonuses, which once hovered around $100-$220 per week, but have now dropped to less than half that.

“Click here to accept this challenge.” I tap the screen to accept. Now, whenever I log into driver mode, a stat meter will appear showing my progress: only 21 more rides before I hit my first bonus. Lyft does not disclose how its weekly ride challenges are generated, but the value seems to vary according to anticipated demand and driver behaviour. The higher the anticipated demand, the higher the value of my bonus. The more I hit my bonus targets or ride quotas, the higher subsequent targets will be. Sometimes, if it has been a while since I have logged on, I will be offered an uncharacteristically lucrative bonus, north of $100, though it has been happening less and less of late.

Behavioural scientists and video game designers are well aware that tasks are likely to be completed faster and with greater enthusiasm if one can visualise them as part of a progression towards a larger, pre-established goal. The Lyft stat meter is always present, always showing you what your acceptance rating is, how many rides you have completed, how far you have to go to reach your goal.

In addition to enticing drivers to show up when and where demand hits, one of the main goals of this gamification is worker retention. According to Uber, 50% of drivers stop using the application within their first two months, and a recent report from the Institute of Transportation Studies at the University of California in Davis suggests that just 4% of ride-hail drivers make it past their first year.

Retention is a problem in large part because the economics of driving are so bad. Researchers have struggled to establish exactly how much money drivers make, but with the release of two recent reports, one from the Economic Policy Institute and one from MIT, a consensus on driver pay seems to be emerging: drivers make, on average, between $9.21 (£7.17) and $10.87 (£8.46) per hour. What these findings confirm is what many of us in the game already know: in most major US cities, drivers are pulling in wages that fall below local minimum-wage requirements. According to an internal slide deck obtained by the New York Times, Uber actually identifies McDonald’s as its biggest competition in attracting new drivers. When I began driving for Lyft, I made the same calculation most drivers make: it is better to make $9 per hour than to make nothing.

Before Lyft rolled out weekly ride challenges, there was the “Power Driver Bonus”, a weekly challenge that required drivers to complete a set number of regular rides. I sometimes worked more than 50 hours per week trying to secure my PDB, which often meant driving in unsafe conditions, at irregular hours and accepting nearly every ride request, including those that felt potentially dangerous (I am thinking specifically of an extremely drunk and visibly agitated late-night passenger).

Of course, this was largely motivated by a real need for a boost in my weekly earnings. But, in addition to a hope that I would somehow transcend Lyft’s crappy economics, the intensity with which I pursued my PDBs was also the result of what Burawoy observed four decades ago: a bizarre desire to beat the game.

Drivers’ per-mile earnings are supplemented by a number of rewards, both material and immaterial. Uber drivers can earn “Achievement Badges” for completing a certain number of five-star rides and “Excellent Service Badges” for leaving customers satisfied. Lyft’s “Accelerate Rewards” programme encourages drivers to level up by completing a certain number of rides per month in order to unlock special rewards like fuel discounts from Shell (gold level) and free roadside assistance (platinum level).

In addition to offering meaningless badges and meagre savings at the pump, ride-hailing companies have also adopted some of the same design elements used by gambling firms to promote addictive behaviour among slot-machine users. One of things the anthropologist and NYU media studies professor Natasha Dow Schüll found during a decade-long study of machine gamblers in Las Vegas is that casinos use networked slot machines that allow them to surveil, track and analyse the behaviour of individual gamblers in real time – just as ride-hailing apps do. This means that casinos can “triangulate any given gambler’s player data with her demographic data, piecing together a profile that can be used to customise game offerings and marketing appeals specifically for her”. Like these customised game offerings, Lyft tells me that my weekly ride challenge has been “personalised just for you!”

Former Google “design ethicist” Tristan Harris has also described how the “pull-to-refresh” mechanism used in most social media feeds mimics the clever architecture of a slot machine: users never know when they are going to experience gratification – a dozen new likes or retweets – but they know that gratification will eventually come. This unpredictability is addictive: behavioural psychologists have long understood that gambling uses variable reinforcement schedules – unpredictable intervals of uncertainty, anticipation and feedback – to condition players into playing just one more round.

A customer leaving a rating and review of an Uber driver. Photograph: Felix Clay/The Guardian

We are only beginning to uncover the extent to which these reinforcement schedules are built into ride-hailing apps. But one example is primetime or surge pricing. The phrase “chasing the pink” is used in online forums by Lyft drivers to refer to the tendency to drive towards “primetime” areas, denoted by pink-tinted heat maps in the app, which signify increased fares at precise locations. This is irrational because the likelihood of catching a good primetime fare is slim, and primetime is extremely unpredictable. The pink appears and disappears, moving from one location to the next, sometimes in a matter of minutes. Lyft and Uber have to dole out just enough of these higher-paid periods to keep people driving to the areas where they predict drivers will be needed. And occasionally – cherry, cherry, cherry – it works: after the Rose Bowl parade last year, I made in 40 minutes more than half of what I usually make in a whole day of non-stop shuttling.

It is not uncommon to hear ride-hailing drivers compare even the mundane act of operating their vehicles to the immersive and addictive experience of playing a video game or a slot machine. In an article published by the Financial Times, long-time driver Herb Croakley put it perfectly: “It gets to a point where the app sort of takes over your motor functions in a way. It becomes almost like a hypnotic experience. You can talk to drivers and you’ll hear them say things like, I just drove a bunch of Uber pools for two hours, I probably picked up 30–40 people and I have no idea where I went. In that state, they are literally just listening to the sounds [of the driver’s apps]. Stopping when they said stop, pick up when they say pick up, turn when they say turn. You get into a rhythm of that, and you begin to feel almost like an android.”

So, who sets the rules for all these games? It is 12.30am on a Friday night and the “Lyft drivers lounge”, a closed Facebook group for active drivers, is divided. The debate began, as many do, with an assertion about the algorithm. “The algorithm” refers to the opaque and often unpredictable system of automated, “data-driven” management employed by ride-hailing companies to dispatch drivers, match riders into Pools (Uber) or Lines (Lyft), and generate “surge” or “primetime” fares, also known as “dynamic pricing”.

The algorithm is at the heart of the ride-hailing game, and of the coercion that the game conceals. In their foundational text Algorithmic Labor and Information Asymmetries: A Case Study of Uber’s Drivers, Alex Rosenblat and Luke Stark write: “Uber’s self-proclaimed role as a connective intermediary belies the important employment structures and hierarchies that emerge through its software and interface design.” “Algorithmic management” is the term Rosenblat and Stark use to describe the mechanisms through which Uber and Lyft drivers are directed. To be clear, there is no singular algorithm. Rather, there are a number of algorithms operating and interacting with one another at any given moment. Taken together, they produce a seamless system of automatic decision-making that requires very little human intervention.

For many on-demand platforms, algorithmic management has completely replaced the decision-making roles previously occupied by shift supervisors, foremen and middle- to upper- level management. Uber actually refers to its algorithms as “decision engines”. These “decision engines” track, log and crunch millions of metrics every day, from ride frequency to the harshness with which individual drivers brake. It then uses these analytics to deliver gamified prompts perfectly matched to drivers’ data profiles.

Because the logic of the algorithm is largely unknown and constantly changing, drivers are left to speculate about what it is doing and why. Such speculation is a regular topic of conversation in online forums, where drivers post screengrabs of nonsensical ride requests and compare increasingly lacklustre, algorithmically generated bonus opportunities. It is not uncommon for drivers to accuse ride-hailing companies of programming their algorithms to favour the interests of the corporation. To resolve this alleged favouritism, drivers routinely hypothesise and experiment with ways to manipulate or “game” the system back.

When the bars let out after last orders at 2am, demand spikes. Drivers have a greater likelihood of scoring “surge” or “primetime” fares. There are no guarantees, but it is why we are all out there. To increase the prospect of surge pricing, drivers in online forums regularly propose deliberate, coordinated, mass “log-offs” with the expectation that a sudden drop in available drivers will “trick” the algorithm into generating higher surges. I have never seen one work, but the authors of a recently published paper say that mass log-offs are occasionally successful.

Viewed from another angle, though, mass log-offs can be understood as good, old-fashioned work stoppages. The temporary and purposeful cessation of work as a form of protest is the core of strike action, and remains the sharpest weapon workers have to fight exploitation. But the ability to log-off en masse has not assumed a particularly emancipatory function. Burawoy’s insights might tell us why.

Gaming the game, Burawoy observed, allowed workers to assert some limited control over the labour process, and to “make out” as a result. In turn, that win had the effect of reproducing the players’ commitment to playing, and their consent to the rules of the game. When players were unsuccessful, their dissatisfaction was directed at the game’s obstacles, not at the capitalist class, which sets the rules. The inbuilt antagonism between the player and the game replaces, in the mind of the worker, the deeper antagonism between boss and worker. Learning how to operate cleverly within the game’s parameters becomes the only imaginable option. And now there is another layer interposed between labour and capital: the algorithm.

After weeks of driving like a maniac in order to restore my higher-than-average driver rating, I managed to raise it back up to a 4.93. Although it felt great, it is almost shameful and astonishing to admit that one’s rating, so long as it stays above 4.6, has no actual bearing on anything other than your sense of self-worth. You do not receive a weekly bonus for being a highly rated driver. Your rate of pay does not increase for being a highly rated driver. In fact, I was losing money trying to flatter customers with candy and keep my car scrupulously clean. And yet, I wanted to be a highly rated driver.

And this is the thing that is so brilliant and awful about the gamification of Lyft and Uber: it preys on our desire to be of service, to be liked, to be good. On weeks that I am rated highly, I am more motivated to drive. On weeks that I am rated poorly, I am more motivated to drive. It works on me, even though I know better. To date, I have completed more than 2,200 rides.

A longer version of this article first appeared in Logic, a new magazine devoted to deepening the discourse around technology

• Follow the Long Read on Twitter at @gdnlongread, or sign up to the long read weekly email here.