AS HE applied sunscreen to his young daughter's face, Dara O'Rourke, a professor of environmental and labour policy at the University of California, Berkeley, found himself wondering if the lotion was safe. He realised there was no readily available answer. The result—two years, a team of chemists, lots of testing and a chunk of venture capital later—is GoodGuide.com. Launched in 2008, this is a website and smartphone app that rates 140,000 consumer products (currently only in America) according to their safety, environmental sustainability and the ethics of the firms that make them. Now GoodGuide has created a new “purchase analyser” app designed to inform consumers not just about the values embedded in products, but also about whether they are the virtuous shoppers they say they want to be.

Using the new app requires selecting a series of characteristics, which can range from whether the user favours organic products to buying only from firms with a good human-rights record. (It also rates how competitively things are priced, via a partnership with Price Grabber.) The consumer then scans the bar code on a product with the camera in their smartphone. The app identifies it and checks in a database to score how it shapes up.

Much therefore depends on the quality of the data, which GoodGuide gathers from various sources, including government reports and scientific studies, and research by its own staff. If the product scores badly, the app will recommend an alternative item which is rated more highly. The app also tracks a consumer's purchases to see how well they fit with their selected values, giving a sort of personal virtue (or hypocrisy) rating.

So far, GoodGuide has mostly been used by shoppers who are already keen to know about any issues connected with products they buy. They are mothers concerned about a child's health, older people facing a chronic illness or supporters of a cause, such as animal rights. The hope behind the app is that the idea of finding out about a product's background will become mainstream.

Consumers rarely change their buying habits, even when confronted with scientific and other data, says Mr O'Rourke. So he has drawn on insights from behavioural economics, which show shoppers can be greatly influenced by peer pressure and by information passed on to them by people they know. The app tries to take advantage of these pressures. The virtue rating will inform a consumer how well they are doing according to the values which they espouse. That measurement gives an incentive to do better. Soon, the rating will be able to be shared with others on social-media sites such as Facebook, which could inspire (or pressurise) a shopper to consume more thoughtfully. It might even, believes Mr O'Rourke, turn being a good shopper into an online game.