Walmart can't worry about e-commerce profitability right now if it wants to compete with Amazon.

Walmart disappointed investors when it reported e-commerce sales growth of just 23% in the fourth quarter. The company had previously been growing online sales over 50% year over year, and it has guided for 40% U.S. e-commerce sales growth in fiscal 2019.

Management said the fourth-quarter slowdown was due to lapping the 2016 acquisition of Jet.com as well as unforeseen operational challenges related to keeping everyday items in stock during the high-demand fourth quarter.

Meanwhile, the company continues to take a loss on its online sales. Initiatives such as free two-day shipping to match Amazon.com's Prime and expanding its online grocery order and pickup system have increased the cost of goods sold online relative to in-store sales.

Analysts asked management about gross margin and profitability on multiple occasions during the company's earnings call. But if Walmart really wants to compete and get to 40% e-commerce sales growth this year, it can't worry about profitability right now.

Amazon faced similar challenges

It's important to note that Amazon isn't immune to the operational challenges Walmart saw last quarter. Just a couple of years ago, investors were worried that Amazon's fulfillment costs were ballooning as it struggled to find space for third-party merchants' inventory in its warehouses.

Amazon went on to invest heavily in further building out its fulfillment network. In the two years since, Amazon's fulfillment center square footage increased about 70%.

And the results have paid off. Amazon's first-party online sales increased 20% year over year in the fourth quarter, while third-party seller services -- a good indicator of third-party sales growth -- increased 41%. Overall, gross merchandise volume growth on Amazon very likely outpaced Walmart's in the fourth quarter despite its massive size.

Will Walmart step up like Amazon?

Even when it faced challenges, Amazon showed it was willing to sacrifice profits to keep sales. Keeping the sale, even at a loss to the company, probably resulted in more repeat customers than if Amazon opted to let some items go out of stock, as Walmart did last quarter.

Walmart's inability to keep sales, either because of fiscal conservatism or being completely unprepared operationally, has already cost it long term at least to some minor degree. Imagine going to buy something on Walmart.com and finding it's not available for shipping. How likely are you to go back the next time you need that item?

Spending more, and losing more, now gives Walmart a good chance of competing online with Amazon, which is quickly moving into groceries -- Walmart's bread and butter.

But commentary from Walmart's management indicates hesitancy to take more losses. The company outlined plans to shift marketing dollars from Jet.com to Walmart.com, as its dollars are more efficient in marketing the latter. Why not spend on both brands?

Regarding the overall loss for e-commerce operations, CEO Doug McMillon said "It's possible we may choose to lose a little more in e-commerce this year than we did last year, but generally speaking, we think it'd be about the same level of losses." He did leave some wiggle room by providing lots of caveats, but overall his comment indicates there are no plans to substantially increase spending to fix the operational challenges it faced in the fourth quarter and prevent them from happening again.

That said, there are some big areas of investment for Walmart this year. It's going to integrate Jet's Smart Cart technology, which offers customers better prices for buying more items at the same time, opting for no returns, or using a debit card over a credit card.

Walmart will also add about 1,000 new stores to its online grocery order and pickup program (a doubling of locations), which management believes will drive it back to 40% online sales growth for the full year. One has to question, however, how an increase in online grocery sales will affect Walmart's in-store sales as it keeps growing.

I'm skeptical Walmart will be able to meet its 40% sales growth outlook if it pulls back on Jet.com marketing and doesn't invest heavily in improving its fulfillment operations. That's basically the exact opposite of what Amazon's done, and if anyone's worth copying in online retail, it's Amazon.