Investors cheered Starbucks'(SBUX -0.17%) latest earnings report, sending the stock up almost 10% Monday to an all-time high.

The headline numbers were solid: Comparable sales were up 3% in the quarter, driving 11% revenue growth to $6.3 billion, which edged out expectations of $6.27 billion. Adjusted earnings per share increased 13% to $0.62, which topped estimates of $0.60. 

The report seemed to restore investor confidence after the stock plunged in June when the company said it would close 150 underperforming stores and lowered its quarterly sales forecast. Indeed, Starbucks' numbers looked solid across the board -- but its comparable sales growth was driven by a price hike rather than increased traffic. 

Globally and in the U.S. traffic fell by 1%, even though comps were up 4% in the U.S. thanks to a 5% increase in the average transaction thanks to higher prices. Traffic growth is crucial for restaurant chains: They can only raise prices so often and by so much, and the most efficient way to generate consistent comparable sales growth is by attracting new customers or enticing the same customers to visit more often.

A barista holds a Starbucks holiday cup.

Image source: Starbucks.

Show me the people

The traffic decline at Starbucks is nothing new. For the fiscal year just finished, traffic was down 1% both globally and in the Americas, which followed a year in which it was flat in both categories. 

The puzzling part here is that the traffic struggles come even as Starbucks is executing in other key initiatives. Starbucks' loyalty program continues to attract new members, as Rewards members increased 15% in the U.S. to 15.3 million. Mobile Order & Pay also saw more adoption among customers, and now accounts for 14% of transactions in the U.S., up from 10% the year before. You would think that given the growth of those two initiatives Starbucks' customer count would be increasing, but that hasn't been the case.

COO Roz Brewer said the company grew transactions during its morning peak hours, but afternoons continue to be a pain point. A combination of factors may be weighing on afternoon traffic, including an oversaturated store base, declining traffic in mall-based stores, and competition, both from other fast-food chains and independent coffee shops. McDonald's, (NYSE: MCD) notably, has made a push for the Starbucks customer with its all-day breakfast and improved coffee lineup.

Not just a Starbucks problem

Traffic has been down broadly in the fast-food industry over the last three years. Black Box Intelligence, an industry research firm, said that traffic across the industry fell 1.3% in the third quarter, though that was actually the best quarterly performance in three years. Despite declining traffic, the overall industry saw comps grow 1.2% as rising prices offset the traffic declines.

McDonald's CEO Steve Easterbrook described a similar struggle, calling the industry a market share battleground and saying, "I don't see many people out there in the sector who are actually growing traffic" on his recent earnings call. Restaurant expansion by chains large and small means that comparable traffic growth has been minimal and sales growth has instead comes from new units. Dunkin' Brands (NASDAQ: DNKN), arguably Starbucks' closest rival, has seen a similar pattern; comparable sales were up 1.3% in its most recent quarter, but traffic declined nonetheless.

What's a coffee giant to do?

Starbucks' management has a plan to lift traffic over the current fiscal year. It's working to free up employees to make more "customer connections" by removing administrative tasks from the store and automating inventory, which will give them more time to focus on store cleanliness and speed of service, in addition to customer relationships. Brewer detailed those initiatives on the earnings call and said that innovations in beverages such as the company's cold brew platform, along with enhancements in its digital experience, would also help drive traffic.

It's clear that there's no silver bullet for Starbucks to solve its traffic challenges, and the broader industry woes should tamp down investor expectations. However, Starbucks trades at a premium to most of its fast-food peers at a P/E of 27, which means that investors are expecting above-average growth from the java giant. In other words, if Starbucks can't solve its traffic problem, the stock is likely to be stuck in neutral, despite the recent post-earnings pop.