Facebook has found the Holy Grail of advertising in a set of new partnerships with point-of-sale systems like Square and Marketo that will prove who bought what after seeing Facebook’s ads. Even if you don’t buy something, Facebook will also now know you visited a store based on a new feature that matches GPS, beacons, WiFi, radio signals, and cell towers with brick-and-mortar coordinates.

This data could get advertisers to spend a lot more on Facebook because it will be able to demonstrate exactly how ad views led to in-store purchases and foot traffic. Ninety percent of sales still happen in physical retail stores, not online. Facebook is pushing to evolve the industry past flimsy metrics like ad views and clicks, towards measuring when ads actually inspired purchases anywhere.

The Offline Conversions API could help Facebook compete with Google for ad dollars. Google has had store visit metrics for AdWords since 2014 and recently launched ads that show maps of nearby locations. Facebook will have to point to its deep data set regarding who people are and what they’re interested in, plus all the ad inventory in its popular News Feed to lure away advertisers.

Though Facebook aggregates and anonymizes the data to protect privacy, the fact that there’s no specific opt-out option is a bit unsettling. All you can do is hide particular ads you see in your feed, or turn off location services for Facebook entirely, which people who are pissed might do even if it degrades other Facebook functionality.

Until now, advertisers had to vaguely correlate sales increases with local ad buys. Even Facebook’s partnerships with offline purchase data providers like Datalogix didn’t produce nearly as precise data. But this new Offline Conversions API lets Facebook jack directly into cash registers and ecommerce sales software to pull real-time results about transactions both in-store and online, plus demographic insights to improve future ad campaigns.

To fuel ad buys seeking foot traffic. Facebook also has a new Store Locator ad unit. It can show a business’ nearby brick-and-mortar locations at the end of an ad carousel and let people “Get Directions”. Instead of having to leave Facebook to visit an unfamiliar website’s store locator, users can view the address, hours, phone number, website and estimated travel time for each store without exiting the social network. They can click through to open directions in their native mapping app.

Maz Sharafi, Facebook’s Director of Monetization Product Marketing tells me “When you think back to the beginning of online advertising, this is what advertisers have been waiting for.”

Ad buyers agree. Argentinean electronics retailer Fravega’s digital marketing manager Mariano Tordo writes that “At Fravega we were able to prove that for every dollar of eCommerce revenue we were generating from Facebook Ads, we were actually getting an additional $2.20 in our brick and mortar stores. With this new solution we were able to optimize our investment and increase spending with confidence.”

E.Leclerc, a French retailer, discovered that around 12% of clicks on one of their ads led to a store visit within 7 days. That’s the kind of data will inspire them to buy more Facebook ads.

Advertisers can partner with IBM, Index, Invoca, Lightspeed, LiveRamp, Marketo, and Square to get offline conversion data through the API, or work with Facebook directly. And since not all users leave their Location Services turned on, Facebook will use representative samples from those who do to extrapolate data and estimate what total percentage of an ad’s viewers walked into the advertiser’s store.

The location data will roll out as a new Store Visits metric in Facebook’s ad performance dashboard over the next few months. Facebook product manager Sam England calls it “a window into a black box”. The data is all anonymized and aggregated for privacy safety so advertisers can’t tell you specifically saw an ad and then bought something or visited a store, just that one of the people they targeted with the ad campaign did.

Uncertainty about return on investment is the key barrier to businesses buying more ads on any platform. But while TV, print, and billboards offer almost no way of attributing sales to ad views, and most online ads can only track online sales that came straight from ad clicks, Facebook is much more omniscient.