Dennis Gray suspected that workers in his pest-control company were spending too much time on personal issues during the workday. So the general manager of Accurid Pest Solutions in southern Virginia quietly installed a piece of GPS tracking software on the company-issued smartphones of five of its 18 drivers.

The software allowed Mr. Gray to log onto his computer to see a map displaying the location and movement of his staff. One employee, he discovered, was visiting the same address a few times a week for a few hours during...