Shopify (SHOP 1.11%) stock is back. Or maybe it never really faded all that much. But with the logistics business now sold off, it's easier to focus on what Shopify has always done best: software for the e-commerce industry.

Of course, not all is perfect, and it's still easy to poke holes in the Shopify investment thesis -- with its current rich valuation among the top concerns. Nevertheless, in an incredibly tough year for retail amid high interest rates and weakening consumer spending, you've got to hand it to the management team. If you're looking for a great investment for the ultra-long term, Shopify still fits the bill. Here's why.

Reading through the quarterly noise

Shopify reported a 25% year-over-year increase in revenue to $1.7 billion in the third quarter. A mix of software to help merchants small and large, digital payments processing, and a myriad of other tools helped fuel the outperformance. Adding to the impressive top-line print for Shopify, giant peers like Amazon are only just beginning to rally as their e-commerce revenue makes a comeback. Smaller operations like Etsy struggled as consumers tightened up their spending as the year progressed.

But of far greater import is Shopify's reclaimed ability to scale up its profitability now that it made the decision to sell its small logistics business (including the Deliverr acquisition from 2022) earlier this year. Operating expenses actually fell year over year, leading Shopify to an operating profit of $122 million versus a $346 million operating loss a year ago.

Operating profit is an important measure. This is especially true considering Shopify's net income in Q3 of $708 million includes big equity gains from its stake in e-commerce partners Affirm (AFRM 5.31%), Global-e Online (GLBE 2.44%), and the recent IPO of marketing automation outfit Klaviyo (KVYO 2.56%). The value of Shopify's equity investments nearly tripled through the first nine months of 2023, from $648 million at the start of the year to $1.91 billion at the end of September.

AFRM Chart

Data by YCharts.

One last profitability metric: free cash flow (FCF). Shopify reached an FCF margin of 16% to $276 million in Q3, compared to negative FCF of $148 million last year. FCF does exclude $102 million of employee stock-based compensation in the quarter, but even that represented progress. Shopify reduced its stock-based comp expense from $150 million in Q3 2022.

In short, Shopify listened to signals from its investors and has delivered the goods. It's well on its way to being a sustainable and highly profitable e-commerce software business again.

Is now a good time to buy?

Just as in previous quarters, and pretty much for the duration of Shopify's history, there's no steal-of-a-deal to be had here. As of this writing, the stock trades for nearly 66 times Wall Street's estimates for 2024 earnings per share, and about the same multiple for enterprise value to next year's expected free cash flow.

With that high valuation, there's an elevated risk of extreme stock price volatility. We've seen that multiple times this earnings season. Expect that to happen to Shopify at some point as well.

Nevertheless, there's still upside for Shopify stock if it can keep up its pace of fast profit growth across multiple metrics. And the company has already proven its durability even in highly turbulent times. That adds to my confidence this could be a great compound growth business for many years to come.

I'm not calling Shopify a top buy now, but it certainly deserves to be considered as a dollar-cost average candidate if it isn't a full position in your portfolio already. This is a top bet on e-commerce as Shopify proves the merits once more of a renewed focus on software.