It has happened to you, and it has probably happened more than once. But you may not have realized why. And you may not have known you were helping to change online advertising and, well, advertising in general.

Chances are, you've bought a hat or a scarf or a Christmas ornament at a department store or a boutique retailer or a roadside stand, and after you swiped your credit card, the clerk or the little card reader on the counter or the card-reading iPad asked for your phone number or your email address.

Yes, the merchant probably wanted to contact you about other stuff you might want to buy—or give others a way of doing the same thing. But that information—your phone number or your email—also provides a way for internet giants like Facebook to show advertisers that ads they post online can lead to purchases in real-world stores.

Facebook recently launched a new tool for online advertisers called Atlas, and part of the company's pitch is that it can explicitly establish a link between online ads and offline purchases. The way it works, says Brian Boland, the vice president of ad tech at Facebook, is that the company can match the phone numbers and email addresses of Facebookers with the phone numbers and email addresses consumers provide in stores. People voluntarily link things like phone numbers and email addresses to their Facebook accounts, and the company gets the store info from various partners, including a data collection company called DataLogix.

"We can do measurement in a revolutionary way," Boland said Wednesday during a discussion with reporters at Facebook headquarters in Menlo Park, California.

That may sound creepy. But Facebook has been doing this sort of thing for about two years, and according to Boland, it's done anonymously. Facebook has developed a system that anonymizes things like phone numbers and email addresses so no one can explicitly link particular names to particular purchases. As Boland explains it, Facebook simply shows advertisers that a given number of people who saw an ad for a product also purchased that product.

>'We can do measurement in a revolutionary way,' Boland says.

What's new is that, through Atlas, Facebook can do this with ads that aren't shown on Facebook. Atlas, you see, is designed to serve ads on sites across the web and across multiple devices, from desktops to smartphones. Even on sites beyond Facebook, the company can match ads to purchases in the real world. It's unclear how effective the technology is, but it shows the general direction the advertising world is moving. As Facebook notes, other companies—including Google and Twitter—can potentially build tools that do much the same thing.

This new world is a dream for advertisers, and for Facebook. It can prove the effectiveness of targeted ads in a way that never existed with billboards or even television. But the question is what it means for consumers—people like you who use Facebook and the rest of the internet. On one level, it could improve how we use the web. A good targeted ad can be useful. But there are other issues to consider.

The Hash

From the outside, says Adi Kamdar, an activist with the Electronic Frontier Foundation, it seems Facebook is "doing a good job" anonymizing personal info as it seeks to link online and offline behavior. Facebook is adamant that its system can't be cracked—i.e. can't be used to match names from Facebook accounts with behavior off of Facebook—and Kamdar says he has no reason to believe otherwise.

Facebook has developed what's called a "hashing" system that converts things like phone numbers and email addresses to a jumble of digital data. Its partners, such as DataLogix, use the same system to anonymize phone numbers and email addresses captured in the real world. The trick is that the hash of a phone number captured on Facebook will look just like the hash of the same phone number captured in a brick and mortar store, so the two companies can match the numbers without actually trading them.

Kamdar adds, however, that Facebook could do more to protect the wishes of users. As it stands, the company lets you opt out of ad targeting, but you can't explicitly opt out of the tracking that Atlas allows. In other words, Atlas tracks you anonymously, but it's still tracking you—and you can't keep it from doing so. "It could be very useful to you if your browsing is linked with your purchases. You might get more-targeted ads, and this might improve your online experience," he says. "But some people don't want to be tracked, even if it's anonymous."

Why? Well, there's the creepiness factor. But Kamdar also says that if you collect information about a person's behavior, there may be ways to determine their identity through that behavior alone.

Enter the Credit Card?

In any event, this is the way the world is moving. Boland acknowledges that Facebook's system can't provide a complete picture of how online ads drive offline purchases. After all, not all purchases are tied to things like phone numbers and addresses, and companies like DataLogix don't collect data on all purchases. But he says that the company can also match up purchases using hashes of things like names, locations, and other data.

On the surface, it seems that Facebook could significantly improve the system if its social network also stored credit card numbers for its users—something it's already moving towards. Using its hashing system, it could potentially know when these cards are used in the real world, bypassing the need to capture phone numbers and email addresses.

Boland says this may or may not work. But he indicates that tracking will indeed improve as time goes on. "I'm not super well versed on the laws and regulations around credit cards," he says. "But the more information people have associated with their account, the more we can match to different purchases."