A push by Hershey Co. to gather data on the nation’s candy-eating habits has uncovered the sweet-tooth capital of America: Utah.

The state buys confections at the highest rate in the nation, almost double the U.S. average, Hershey researchers found. Twizzlers are especially popular in the Salt Lake City area, according to the company.

More than 60 percent of Utah’s residents are Mormons, who typically abstain from alcohol, caffeine and tobacco. With those vices frowned upon, candy is an acceptable treat, said Glenn Christensen, a marketing professor Brigham Young University’s Marriott School of Management. Sweets are ubiquitous at family gatherings and church events, he said.

“We don’t drink alcohol, we don’t smoke, we avoid coffee — but we certainly do sugar,” Christensen said. “It’s the only allowed indulgence.”

In addition to a big Mormon population, Utah has a bountiful number of candy’s biggest fans — children. In 2013, 31 percent of the state’s residents were younger than 18, compared with 23 percent for the national average.

“We have tons of kids,” Christensen said.

Utah’s penchant for candy wasn’t the only statistical quirk unearthed by Hershey researchers. They found that customers in Minnesota buy six-packs of Hershey bars at higher rates than any other Americans, particularly in the summer. The reason: s’mores.

Minnesotans flock to the state’s lakes and campgrounds during the warmer months, said Bob Goodpaster, Hershey’s chief global knowledge officer. Sales slipped in 2012 when Minnesota banned campfires because of hot, dry weather.

“All of this stuff is steeped in tradition,” he said. “They’ve been doing s’mores in the Midwest for a long time.”

Hershey’s push to better analyze its sales data began in 2008. The century-old candy company had just lost its No. 1 spot in the U.S. market to Mars Inc., which acquired Wrigley that year. Hershey wanted to make sure it maintained its influence with retailers, and the company figured that having a better command of its data would help.

Hershey had decades of market research and started adding new sales data that gave a more detailed picture of how customers were shopping across the U.S. In 2013, Hershey became the first consumer-packaged goods company to work with Palantir Technologies Inc., the CIA-backed analytics software firm founded by Silicon Valley venture capitalist Peter Thiel.

“We knew if we wanted to maintain our status we had to earn it, and we’ve chosen to earn it by doing a better job with insights,” Goodpaster said. “I’m trying to run a consulting company for retailers.”

Another finding was that Hispanics like Hershey’s Cookies ’n Creme bars in disproportionate numbers, Goodpaster said. The data “allows us to make better product decisions,” he said. “We’re constantly uncovering nuggets.”