See more of the story

The potent combination of three-martini lunches and creative genius in "Mad Men," a television show about 1960s Madison Avenue, is a fair representation of the advertising industry's past. For its future, though, look to a 2002 film, "Minority Report," starring Tom Cruise and set in 2054. Cruise, as usual, spends a lot of time on the run. When he dashes past a digital billboard it takes note of his exertions, remarking, "You could use a Guinness right about now."

Modern advertising is not far from the world of "Minority Report." Internet ads account for around a quarter of the $500 billion in global advertising. The confluence of mobile devices and social networks allows advertisers to track and target people to a degree once reserved for fiction. As people spend more time online, thousands of firms invisibly gather intelligence about them.

By monitoring websites people visit, these companies can infer their location, income, family size, education, age, employment and much more. One data firm has compiled a billion profiles of potential customers, each with an average of 50 attributes. Consumers are lumped into "segments" such as "men in trouble" — presumed to have relationship problems because they are shopping for chocolates and flowers — or "burdened by debt: small-town singles." When people visit websites, advertisers bid to show them precisely targeted ads. The auctions take milliseconds and the ad displays when the website loads.

Targeted advertising has advantages for consumers. It pays for many popular websites that people enjoy free of charge. Relevant ads can be more useful to consumers than irrelevant ones.

Most consumers have no idea how closely they are being followed online. They do not know that Facebook's "Like" and Twitter's "tweet" buttons on other websites allow those companies to track users, even if they don't click on them. They have no notion that on popular websites up to 1,300 companies are watching what they do.

Although companies that buy and sell data insist that they use numbers, not names, to identify individuals, it is getting easier to pinpoint people. New tools let retailers use wireless technologies to see when particular customers walk in a store.

Such information could be used against consumers. Someone categorized by a data broker as a "motorcycle enthusiast" might see his rates for medical or accident insurance rise. "Men in trouble" might find it harder to get a job. Until objections were raised, dating site OKCupid sold data about people's drug and alcohol consumption.

People should be able to find out if they are being tracked and what information companies are holding about them, and they should be able to stop companies tracking them if they want. The U.S. has relied on industry to regulate itself, but it has done too little to protect people's privacy. European sites are required to make it clear to consumers when they are being tracked by third-party cookies, and people opt into data collection rather than opt out. Just as U.S. consumers can get their credit reports, so they should be able to get access to digital dossiers companies hold on them.

Since revelations of surveillance can damage a firm's reputation, advertisers would do well to go further voluntarily. In the same way that some consumers turned against clothing companies that used sweatshop labor, consumers could rebel against firms that invade their privacy. Advertisers should take a good look at their data supply-chains and strengthen consumers' right to control their digital information. Surveillance works in the movies, but it may not be a sustainable business model.

Copyright 2013 The Economist Newspaper Limited, London. All Rights Reserved. Reprinted with permission.