Image copyright Getty Images Image caption There is a wrong and right way to carry out workplace surveillance

Is workplace surveillance about improving productivity or simply a way to control staff and weed out poor performers?

Courtney Hagen Ford, 34, left her job working as a bank teller because she found the surveillance she was under was "dehumanising".

Her employer logged her keystrokes and used software to monitor how many of the customers she helped went on to take out loans and fee-paying accounts.

"The sales pressure was relentless," she recalls. "The totality was horrible."

She decided selling fast food would be better, but ironically, left the bank to do a doctorate in surveillance technology.

Courtney is not alone in her dislike of this kind of surveillance, but it's on the rise around the world as firms look to squeeze more productivity from their workers and become more efficient.

Image copyright Courtney Hagen Ford Image caption Courtney Hagen Ford says having her every move monitored was "dehumanising"

More than half of companies with over $750m (£574m) in annual revenue used "non-traditional" monitoring techniques on staff last year, says Brian Kropp, vice-president of research firm Gartner.

These include tools to analyse e-mails, conversations, computer usage, and employee movements around the office. Some firms are also monitoring heart rates and sleep patterns to see how these affect performance.

In 2015, 30% used such tools. Next year, Mr Kropp expects 80% will.

And workforce analytics will be a $1.87bn industry by 2025, says San Francisco's Grand Review Research.

So why is business so keen?

Ben Waber, chief executive of Humanyze, a Boston workplace analytics company, says it gives firms the ability to assess how their staff are performing and interacting, which can be good for the firm but also good for employees themselves.

Image copyright Robin Lubbock Image caption Humanyze's Ben Waber thinks firms need to find our more about how they function

His company gathers "data exhaust" left by employees' email and instant messaging apps, and uses name badges equipped with radio-frequency identification (RFID) devices and microphones.

These can check how much time you spend talking, your volume and tone of voice, even if you dominate conversations. While this may sound intrusive - not to say creepy - proponents argue that it can also protect employees against bullying and sexual harassment.

Humanyze calls these badges "Fitbit for your career".

Some of this data analysis can produce unexpected results, says Mr Waber. For example, one large tech client discovered that coders who sat at 12-person lunch tables tended to outperform those who regularly sat at four-person tables.

The larger tables led to more interaction with staff from other parts of the company, he says, and this improved idea sharing.

Larger lunch tables were "driving more than a 10% difference in performances". A fact that would probably have gone undetected without such data analysis.

Media playback is unsupported on your device Media caption The chip allows employees to open doors and use the photocopier without a traditional pass card

Over the last few years a Stockholm co-working space called Epicenter has gone much further and holds popular "chipping parties", where people can have RFID-enabled rice-sized microchips implanted in their hands.

They can use the implants to access electronically controlled doors, swap contacts, or monitor how typing speed correlates with heart rate, says Epicenter's Hannes Sjöblad, who has an implant himself.

The implant "cannot transmit any data unless you put it within a centimetre of a reader, so the person with the implant controls when it can be read", he says.

Embedded chips may seem extreme, but it is a relatively small step from ID cards and biometrics to such devices, says Prof Jeffrey Stanton, a University of Syracuse academic who researches work-related stress.

As long as such schemes are voluntary, "there will probably be a growing number of convenience-oriented uses such that a substantial number of workers would opt to have a chip implanted", he believes.

But if embedded chips are used to reduce slack time or rest breaks, "we are probably in the bad zone", he says. And if surveillance tools "take away autonomy", that's when they prove most unpopular.

Image copyright Gartner Image caption Gartner's Brian Kropp says bad communication can scupper monitoring projects

A lot depends on how such monitoring initiatives are communicated, Gartner's Mr Kropp argues.

In 2016, Britain's Telegraph newspaper installed heat and motion monitoring devices under employees' desks. While management said it was to find out which desks were occupied for energy management purposes, staff thought they were being spied on and staged a revolt.

The devices were removed after 24 hours.

If bosses don't communicate effectively, employees assume the worst, Mr Kropp says. But if they're open about the information they're collecting - and what they're doing with it - 46% of employees are "generally okay with it".

Although many such monitoring schemes use anonymised data and participation is voluntary, many staff remain sceptical and fear an erosion of their civil liberties. In less liberal countries, workers are not given any choice at all.

But for some, the benefits are obvious.

Image copyright Jessica Johnson Image caption Jessica Johnson says her workplace tracking software helps her cope with narcolepsy

"I've got a condition called narcolepsy," explains Jessica Johnson, 34, from Canberra, Australia.

She falls asleep for short periods during the day, then is disorientated when she wakes.

This "impacts my memory, my ability to focus and concentrate," she says.

She worked with an insurance company where employees used a programme called Timely to track billable hours. It helped her quickly find what she had been doing before she fell asleep, and pick up where she left off.

"You install it on your phone, and then on your computer, and that's how you get all the raw data," says Mathias Mikkelsen, Timely's Norwegian chief executive.

More Technology of Business

"Machine learning algorithms analyse all the data, and create beautiful charts," he says.

You can then see how much time you're wasting in unproductive meetings, say, or replying to e-mails.

You could show managers you were "spending so much time on stuff that's not what you were hired to do," says Mr Mikkelsen.

So workplace surveillance could be empowering for staff and useful for companies looking to become more efficient and profitable.

But implemented in the wrong way, it could also become an unpopular tool of oppression that proves counterproductive.

Follow Technology of Business editor Matthew Wall on Twitter and Facebook