Chipotle has had to win customers back following an E.coli breakout. Foursquare has tracked its saga closely via foot traffic data.  (Steven Senne/AP)

Chipotle announced its first loss as a public company Tuesday. But two weeks earlier, an unlikely source —the social media app Foursquare — had beat Chipotle to the punch, predicting in a blog post that the burrito maker’s sales would drop nearly 30 percent. Chipotle made it official Tuesday afternoon — reporting a drop of 29.7 percent. 

The remarkably accurate prediction from a company consumers know for restaurant tips and the ability to check in at locations highlights the emerging power of the gobs of data our smartphones collect and the opportunity for savvy companies to convert that information into piles of cash.

“In biology the microscope changed the world. In physics and astronomy, the telescope,” said University of Illinois at Urbana-Champaign professor Lav Varshney. “These data sets give a very detailed view of human behavior. It’s a really powerful instrument in all kinds of settings.”

Foursquare has spent seven years collecting data and has 85 million places in its database. It describes its data trove as the “biggest foot traffic panel in the world.” Clients that buy Foursquare’s data to glean insights include retailers, real estate developers, Wall Street traders and consumer package-goods companies.

Foursquare, the seven-year-old start-up, cleverly turned smartphone data into predictions on Chipotle sales that matched Wall Street analysts with far more experience in projecting the successes of businesses such as Chipotle. Last year, Foursquare used its foot-traffic data to predict how many iPhones Apple would sell on a given weekend. Foursquare predicted sales of 13 million to 15 million. Apple then announced sales of more than 13 million.

“This is a glimpse into fundamental things that could change around how we do predictions of earnings and profits for public-traded companies,” said Josh Sullivan, a Booz Allen Hamilton senior vice president who leads its data science and advanced analytics efforts. “These intelligent machines are going to be able to start approaching the level humans can do and then keep going. That’s going to be fascinating.”

Experts say we’re witnessing this change because of three reasons: More data is available, computers are getting more powerful, and there are algorithms available to analyze the data.

Once a handful of Foursquare users have checked in at a location, the company knows that a given location represents a certain store. If the smartphones of another Foursquare user move inside these premises — but doesn’t check in — Foursquare still knows the user was in the store. Foursquare relies on GPS data, WiFi, cell towers and beacons to pinpoint where smartphone users are.

Data experts caution that there are limits to how far Foursquare can replicate its Chipotle predictions elsewhere. They say Foursquare’s success will work best at large chains. Foursquare needs a lot of data to make such predictions, so it would probably struggle to accurately predict the sales of a retailer that has only a handful of locations.

Another limitation to Foursquare’s approach is the nature of a store. Chipotle lends itself to a foot-traffic analysis because customers overwhelmingly travel in person to a store to get their food. It would be more difficult to predict the sales at a business that sells a significant amount of goods online.