Walmart (NYSE:WMT) posted another quarter of rapid growth in online sales in the United States. E-commerce sales for Walmart U.S. rose 41% in Q3, accelerating from 37% growth. That's also notably much faster than Amazon's (NASDAQ:AMZN) 24% increase in North American sales (an acceleration as well).

Walmart has made several efforts to catch up to Amazon this year, including offering next-day delivery on thousands of items and a new $98 same-day grocery delivery subscription that's now available from 1,400 of its Supercenters.

But diving into Walmart's earnings results and management's commentary shows the company still has a lot of work to do in order to catch up with Amazon.

A man holding boxes and turning a doorknob.

Image source: Walmart.

Walmart's winning grocery budgets

Walmart has invested a lot in its grocery business over the last couple years, and it's paid off handsomely. Grocery comparable sales grew in the mid-single-digit percentage last quarter. That compares to 2.2% identical-store sales at Kroger (NYSE:KR) in the second quarter.

Walmart's digital sales growth still comes primarily from consumers shifting their grocery shopping online and choosing instead of their nearby supermarket. Kroger is also experiencing strong growth in online sales, up 31% in the second quarter, despite not having the same reach as Walmart. Kroger also charges a convenience fee for online orders, but recently announced plans to remove that fee in some markets.

"Our strength is being driven by food, which is good, but we need even more progress on with general merchandise," CEO Doug McMillon said in his commentary on Walmart's third-quarter results. "We need to translate this repetitive food and consumable volume into a stronger business that's profitable over time."

Walmart is reportedly set to lose $1 billion from its e-commerce efforts this year. It's downsized some over the last few months, shedding Modcloth and culling other parts of its digital portfolio. Management said the online business showed operational leverage in the third quarter. 

Still, the best way to improve profitability is to sell goods with wider profit margins. Groceries have some of the thinnest margins in retail. When you add fulfillment costs to the mix, it's no wonder Walmart's losing tons of money on its online sales.

Walmart has certainly done a good job at convincing consumers to use its website more often. A recent survey from First Insight found Walmart is seeing an increase in shopper preference over Amazon. But those shoppers appear to be leaning on specifically for grocery items, while Amazon continues to see general merchandise sales climb.

Amazon is taking away general merchandise sales

Walmart's struggle to grow general merchandise sales online is exacerbated by Amazon's recent efforts to improve Prime. The online retail giant started offering one-day delivery on millions of items over the summer, and it quietly reduced the order threshold on inexpensive convenience items. Shoppers typically run to a brick-and-mortar store for those items because they need them quickly, but Amazon's one-day shipping makes it a more convenient option for more people.

Amazon is still the first place shoppers consider when they think about general merchandise. The head of Walmart's U.S. e-commerce, Marc Lore, even admitted shoppers don't have a reason to think, "Oh yeah! I'm gonna use," at a recent conference.

He believes that can change over time if it starts delivering more general merchandise through its Delivery Unlimited program. That said, other same-day grocery and general merchandise delivery services like Target's Shipt have failed to significantly cut into Amazon's dominance.

There's a lot more innovation Walmart needs to do if it wants to compete for more profitable online sales. While the success in grocery is great, "there is more work to do," as McMillon said in his remarks.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.