If you’re on Facebook, chances are you’ve either played or been invited to FarmVille, CityVille, or Mafia Wars — three of Zynga’s most popular games. Zynga pioneered social gaming as we know it today, setting the tone for successors like Candy Crush and Temple Run. Zynga is much more than a casual gaming company though – it’s a data and analytics powerhouse that has revolutionized data-driven product development and optimization.

Because I’ve bet my career and my company on using data to understand user behavior, I’ve followed Zynga with great interest for years. What its product and analytics team did years ago is what any mainstream company with a mobile app or web site needs to do today to maintain a competitive edge and drive growth.

Zynga product developers understood the importance of robust user analytics from the beginning. While other gaming companies were only looking at basic counters, Zynga recognized that it was user behavior that really needed to be understood in order to spark viral engagement. This unconventional approach to analytics helped catapult Zynga from zero to hero almost overnight.

Tracking user behavior at a granular level was a fairly new concept when Zynga launched. At the time, there weren’t any analytics platforms that met their needs, so Zynga’s engineers built their own analytics infrastructure. Zynga’s original approach to analytics has inspired some of the brightest minds in technology to craft their analytics models in the same way, applying lessons they took from Zynga to industries beyond social gaming.

Here’s what you can learn from Zynga that has nothing to do with farm animals or the mob.

1. Create analytical models before launch to measure expectations

Before launching any Zynga game, the team built an analytical model for the game’s performance. The model examined factors like the viral hooks built into the product and the user acquisition channels. From this data, the model attempted to predict key metrics, including the number of new installs per day and how that would decay over time, virality K-factor over time, Day 1 retention over time, and revenue per daily active user.

Teams used these models as a basis for understanding how to engineer the game for maximum growth, engagement, and revenue. These models also provided a baseline for comparison, so that as soon as the game launched, the team could quickly gauge whether or not it was on track to meet expectations.

2. Don’t chase short-term gains at the expense of durable growth

Having too narrow a focus on short-term gains can cost you long term revenue, as was the case with Zynga. A prime example of this was its ‘flash sales’ campaign. In Zynga games, there are virtual goods for a set price. The first time Zynga ran a sale on these, it was immensely successful. Revenue on that day shot through the roof.

In the short term, the data suggested that sales were a great driver of revenue — more users were converting to buyers. But eventually, the strategy backfired. Users came to expect the sales, and Zynga found itself running bigger sales more frequently to get users to buy more virtual currency. Over the long term, the sales strategy was a net negative, as users had more currency than they could spend, and sales became less and less effective.

3. Data shouldn’t rule your world

Zynga didn’t ascend the social gaming throne through the content of its games. In fact, Zynga’s former VP of Analytics, Ken Rudin, is famously quoted as saying that Zynga was “an analytics company masquerading as a games company.”

Although Zynga’s focus on metrics led to extremely successful growth and revenue initially, some Zynga alumni think the company may have been too data-driven. The flash sales backfire is one example of how looking purely at the numbers led to the wrong decision.

Former Zynga product manager and current cofounder of Rocket Games, Niko Vuori, recently recounted to me that Zynga’s laser focus on metrics may have been one of the main reasons it missed out on things that are more difficult to measure, though just as crucial, like improving the overall usability of a game. “What ended up happening is people were exceptionally focused on the data and didn’t spend enough time looking at the qualitative gameplay,” said Vuori. “The main thing I think a lot of us have taken from Zynga is that data has its place, it helps you make decisions, but you should still be open to doing things that are different, that are gut-driven. Data should not rule your world.”

Roy Sehgal, an early vice president and general manager at Zynga who is now an investor in my company, told me how important it is to have good hypotheses before diving into the data. “Data-driven is a loaded term,” he said. “I believe you need to be hypothesis-driven and use data to validate (or invalidate) your hypotheses. The data identifies where your hypotheses were right or wrong and highlights areas of potential improvement to the user experience.”

Although they made some mistakes along the way, Zynga’s metrics-driven culture allowed it to standardize social gaming while simultaneously introducing the world to data-driven product development and optimization. Today, with so much data being captured through the web and on mobile, companies in every industry are more capable than ever to turn user data into their most powerful business tool.

Spenser Skates founded mobile event-based analytics startup Amplitude in 2012 with cofounder Curtis Liu. Prior to that he founded text-by-voice Android app Sonalight and worked as a Algorithmic Trader for DRW Trading Group.