Shopify (SHOP -1.07%) was among the best-performing stocks immediately after COVID-19 hit in March 2020. At one point, the company could do no wrong as the pandemic significantly accelerated trends that management had made big bets on.

But in a massive reversal of fortunes, the company has recently fallen on hard times, and you might wonder what is going on with Shopify. Here's one big bet that failed to pay off.

A person taking items out of a delivery box.

Image source: Getty Images

Shopify's big wager on e-commerce

At the beginning of the pandemic, e-commerce became the only way people could shop, as the need to stop the spread of the virus shut down physical stores. And by May 2020, retail experts estimated that the pandemic had accelerated e-commerce growth four to six years ahead of where it would have been if growth had continued at pre-pandemic levels. The Census Bureau's 2020 Annual Retail Trade Survey showed e-commerce sales rising 43% to $815.4 billion, compared to 14.3% in 2019.

Shopify management, seeing this significant acceleration across 2020, projected that online spending would permanently grow at a much higher rate. And to keep up with that projection, the company made a calculated bet to invest more in its e-commerce business.

But that bet doesn't look like it is paying off. Instead, e-commerce has fallen back to the pre-pandemic growth trend line.

Moreover, as a result of being wrong in its projections, Shopify is currently investing too much money compared to the industry's growth rate. This overspending has dire consequences for the company in an economy that many experts believe is entering a recession.

This fumble has resulted in the company transforming from profitability to being unprofitable. That's terrible in this environment, where investors are selling off shares of unprofitable companies.

SHOP Net Income (TTM) Chart

SHOP net income (TTM). Data by YCharts. TTM = trailing 12 months.

During the company's second-quarter earnings call, Shopify's chief financial officer said it was already taking steps to slow spending. It is laying off 10% of its global workforce. Now the trick is not gutting potentially valuable areas of the company while identifying the areas with the best opportunity for long-term solid returns.

In the long run, Shopify's future is still intact

Although Shopify messed up its e-commerce growth estimation, the market has arguably priced many of the company's ills into its valuation. It currently has a price-to-sales (P/S) ratio of 10.3, far below the 60.9 P/S ratio in 2020 -- an excellent valuation for long-term investors who are considering buying a few shares.

SHOP PS Ratio Chart

SHOP PS ratio. Data by YCharts.

Besides the great valuation, there are two reasons investors can feel confident in Shopify's long-term stock appreciation.

First, although persistent inflation and rising interest rates have dampened consumer spending, Shopify's gross merchandise value (GMV), or the value of goods sold on its platform, is healthier than the broader retail market.

For instance, its GMV for 2021 increased 47% over 2020, while the broader retail market grew 17.9% over the same period. That outperformance continued into 2022, with the company's first-quarter GMV up 16% from a year ago, compared to total retail sales rising 10.9% over the same period. And Shopify expects that outperformance to continue, which will be great for the company when retail spending eventually recovers.

Second, although Shopify struck out by betting too much on higher e-commerce growth, the company did make what is turning out to be a wise bet by investing in omnichannel retailing, which allows consumers to choose how they shop, whether at home, via mobile, or inside a physical store.

Market data company ReportLinker estimates that the global market for retail omnichannel commerce platforms is currently $8 billion. It projects the number to reach $14.6 billion by 2026, a compound annual growth rate of 16.2%, with U.S. retail omnichannel commerce -- the largest market -- reaching $4 billion by 2026. Consequently, Shopify is shifting its investments to ensure it can profit significantly in this new and growing market. 

The near term is bleak

Although Shopify has an excellent long-term future, its stock is unlikely to recover soon. The company expects inflation and soft retail spending to persist until the year ends. So risk-averse investors should probably avoid Shopify for now.